Skip to content
Extraits de code Groupes Projets
Valider a9db42a9 rédigé par Eugen Rochko's avatar Eugen Rochko
Parcourir les fichiers

Validations for local profiles

parent 5c99e304
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -13,3 +13,5 @@ ADD Gemfile.lock /mastodon/Gemfile.lock
RUN bundle install --deployment --without test --without development
ADD . /mastodon
VOLUME ['/mastodon/public/system']
......@@ -25,7 +25,7 @@ module StreamEntriesHelper
status.mentions.each { |m| mention_hash[m.acct] = m }
coder = HTMLEntities.new
auto_link(coder.encode(status.text), link: :urls, html: { target: '_blank', rel: 'nofollow' }).gsub(Account::MENTION_RE) do |m|
auto_link(coder.encode(status.text), link: :urls, html: { rel: 'nofollow noopener' }).gsub(Account::MENTION_RE) do |m|
account = mention_hash[Account::MENTION_RE.match(m)[1]]
"#{m.split('@').first}<a href=\"#{url_for_target(account)}\" class=\"mention\">@<span>#{account.acct}</span></a>"
end.html_safe
......
......@@ -12,6 +12,10 @@ class Account < ActiveRecord::Base
has_attached_file :header, styles: { medium: '700x335#' }
validates_attachment_content_type :header, content_type: /\Aimage\/.*\Z/
# Local user profile validations
validates :display_name, length: { maximum: 30 }, if: 'local?'
validates :note, length: { maximum: 124 }, if: 'local?'
# Timelines
has_many :stream_entries, inverse_of: :account
has_many :statuses, inverse_of: :account
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter