Merge pull request #2369 from riking/anchors-internal

Consider URLs starting with # as internal
This commit is contained in:
Jeff Atwood 2014-05-20 00:56:38 -07:00
commit ebcfdde752
1 changed files with 1 additions and 0 deletions

View File

@ -129,6 +129,7 @@ Discourse.URL = Em.Object.createWithMixins({
**/
isInternal: function(url) {
if (url && url.length) {
if (url.indexOf('#') === 0) { return true; }
if (url.indexOf('/') === 0) { return true; }
if (url.indexOf(this.origin()) === 0) { return true; }
if (url.replace(/^http/, 'https').indexOf(this.origin()) === 0) { return true; }