Fix wrongful matching of last period in extended usernames
Fix anchor tags in some wikipedia URLs being matches as a hashtag
This commit is contained in:
parent
5f4e402204
commit
4fb95c91fb
4 changed files with 20 additions and 3 deletions
|
@ -4,7 +4,7 @@ class Account < ApplicationRecord
|
|||
include Targetable
|
||||
include PgSearch
|
||||
|
||||
MENTION_RE = /(?:^|[^\/\w])@([a-z0-9_]+(?:@[a-z0-9\.\-]+)?)/i
|
||||
MENTION_RE = /(?:^|[^\/\w])@([a-z0-9_]+(?:@[a-z0-9\.\-]+[a-z0-9]+)?)/i
|
||||
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze
|
||||
|
||||
# Local users
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
class Tag < ApplicationRecord
|
||||
has_and_belongs_to_many :statuses
|
||||
|
||||
HASHTAG_RE = /(?:^|[^\/\w])#([[:word:]_]*[[:alpha:]_][[:word:]_]*)/i
|
||||
HASHTAG_RE = /(?:^|[^\/\)\w])#([[:word:]_]*[[:alpha:]_][[:word:]_]*)/i
|
||||
|
||||
validates :name, presence: true, uniqueness: true
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue