mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #2369 from riking/anchors-internal
Consider URLs starting with # as internal
This commit is contained in:
commit
ebcfdde752
@ -129,6 +129,7 @@ Discourse.URL = Em.Object.createWithMixins({
|
|||||||
**/
|
**/
|
||||||
isInternal: function(url) {
|
isInternal: function(url) {
|
||||||
if (url && url.length) {
|
if (url && url.length) {
|
||||||
|
if (url.indexOf('#') === 0) { return true; }
|
||||||
if (url.indexOf('/') === 0) { return true; }
|
if (url.indexOf('/') === 0) { return true; }
|
||||||
if (url.indexOf(this.origin()) === 0) { return true; }
|
if (url.indexOf(this.origin()) === 0) { return true; }
|
||||||
if (url.replace(/^http/, 'https').indexOf(this.origin()) === 0) { return true; }
|
if (url.replace(/^http/, 'https').indexOf(this.origin()) === 0) { return true; }
|
||||||
|
Loading…
Reference in New Issue
Block a user