mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Incorrect string match
This commit is contained in:
parent
71aed34e64
commit
9097368038
2 changed files with 2 additions and 2 deletions
|
@ -99,7 +99,7 @@ Discourse.URL = Em.Object.createWithMixins({
|
|||
if (url && url.length) {
|
||||
if (url.indexOf('/') === 0) { return true; }
|
||||
if (url.indexOf(this.origin()) === 0) { return true; }
|
||||
if (url.replace(/^http[^s]/, 'https').indexOf(this.origin()) === 0) { return true; }
|
||||
if (url.replace(/^http/, 'https').indexOf(this.origin()) === 0) { return true; }
|
||||
if (url.replace(/^https/, 'http').indexOf(this.origin()) === 0) { return true; }
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -15,7 +15,7 @@ class TopicLinkClick < ActiveRecord::Base
|
|||
|
||||
if args[:url] =~ /^http/
|
||||
http_url = args[:url].sub(/^https/, 'http')
|
||||
https_url = args[:url].sub(/^http[^s]/, 'https')
|
||||
https_url = args[:url].sub(/^http/, 'https')
|
||||
link = TopicLink.select([:id, :user_id]).where('url = ? OR url = ?', http_url, https_url)
|
||||
else
|
||||
link = TopicLink.select([:id, :user_id]).where(url: args[:url])
|
||||
|
|
Loading…
Reference in a new issue