Dont match mention in url query string (#25656)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
		
							parent
							
								
									2f8f92df48
								
							
						
					
					
						commit
						c676bc91e9
					
				| @ -255,10 +255,6 @@ RSpec/MultipleMemoizedHelpers: | |||||||
| RSpec/NestedGroups: | RSpec/NestedGroups: | ||||||
|   Max: 6 |   Max: 6 | ||||||
| 
 | 
 | ||||||
| RSpec/PendingWithoutReason: |  | ||||||
|   Exclude: |  | ||||||
|     - 'spec/models/account_spec.rb' |  | ||||||
| 
 |  | ||||||
| # This cop supports unsafe autocorrection (--autocorrect-all). | # This cop supports unsafe autocorrection (--autocorrect-all). | ||||||
| Rails/ApplicationController: | Rails/ApplicationController: | ||||||
|   Exclude: |   Exclude: | ||||||
|  | |||||||
| @ -66,7 +66,7 @@ class Account < ApplicationRecord | |||||||
|   BACKGROUND_REFRESH_INTERVAL = 1.week.freeze |   BACKGROUND_REFRESH_INTERVAL = 1.week.freeze | ||||||
| 
 | 
 | ||||||
|   USERNAME_RE   = /[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?/i |   USERNAME_RE   = /[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?/i | ||||||
|   MENTION_RE    = %r{(?<=^|[^/[:word:]])@((#{USERNAME_RE})(?:@[[:word:].-]+[[:word:]]+)?)}i |   MENTION_RE    = %r{(?<![=/[:word:]])@((#{USERNAME_RE})(?:@[[:word:].-]+[[:word:]]+)?)}i | ||||||
|   URL_PREFIX_RE = %r{\Ahttp(s?)://[^/]+} |   URL_PREFIX_RE = %r{\Ahttp(s?)://[^/]+} | ||||||
|   USERNAME_ONLY_RE = /\A#{USERNAME_RE}\z/i |   USERNAME_ONLY_RE = /\A#{USERNAME_RE}\z/i | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -700,7 +700,7 @@ RSpec.describe Account do | |||||||
|       expect(subject.match('Check this out https://medium.com/@alice/some-article#.abcdef123')).to be_nil |       expect(subject.match('Check this out https://medium.com/@alice/some-article#.abcdef123')).to be_nil | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     xit 'does not match URL query string' do |     it 'does not match URL query string' do | ||||||
|       expect(subject.match('https://example.com/?x=@alice')).to be_nil |       expect(subject.match('https://example.com/?x=@alice')).to be_nil | ||||||
|     end |     end | ||||||
|   end |   end | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user