about summary refs log tree commit diff
path: root/app/models/tag.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-07-18 03:02:56 +0200
committerGitHub <noreply@github.com>2019-07-18 03:02:56 +0200
commit84e988479e956bcf522072879da936b100d1d46b (patch)
tree470aab6fa5dc21e55294538e2e6a43010e2b8dd8 /app/models/tag.rb
parent4906cabc6b8d91136973ad159f6a02209ea8e166 (diff)
Fix only one middle dot being recognized in hashtags (#11345)
Fix #10934
Diffstat (limited to 'app/models/tag.rb')
-rw-r--r--app/models/tag.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/tag.rb b/app/models/tag.rb
index 7db76d157..01bace2bb 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -17,7 +17,7 @@ class Tag < ApplicationRecord
   has_many :featured_tags, dependent: :destroy, inverse_of: :tag
   has_one :account_tag_stat, dependent: :destroy
 
-  HASHTAG_NAME_RE = '[[:word:]_]*[[:alpha:]_·][[:word:]_]*'
+  HASHTAG_NAME_RE = '[[:word:]_][[:word:]_]*[[:alpha:]_·]*[[:word:]_·]*[[:word:]_]'
   HASHTAG_RE = /(?:^|[^\/\)\w])#(#{HASHTAG_NAME_RE})/i
 
   validates :name, presence: true, uniqueness: true, format: { with: /\A#{HASHTAG_NAME_RE}\z/i }