From d31996eacae45f0d023fc99c48a740a7e81d8957 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 12 May 2014 16:30:00 -0400 Subject: [PATCH] FIX: Allow users to create protocol relative URLs in posts. --- app/assets/javascripts/discourse/lib/url.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/discourse/lib/url.js b/app/assets/javascripts/discourse/lib/url.js index 515a394f3f5..1d3cb3315d0 100644 --- a/app/assets/javascripts/discourse/lib/url.js +++ b/app/assets/javascripts/discourse/lib/url.js @@ -59,6 +59,12 @@ Discourse.URL = Em.Object.createWithMixins({ return; } + // Protocol relative URLs + if (path.indexOf('//') === 0) { + document.location = path; + return; + } + // Scroll to the same page, differnt anchor if (path.indexOf('#') === 0) { var $elem = $(path);