From 35bef72d4ed6d530468bdc091bc076d431a2cdc4 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 8 Aug 2018 13:41:29 -0400 Subject: [PATCH] FIX: subfolder redirects to wrong URL if the subfolder appears in the slug --- app/assets/javascripts/discourse/lib/discourse-location.js.es6 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/discourse-location.js.es6 b/app/assets/javascripts/discourse/lib/discourse-location.js.es6 index 67df87c2ca..576b135de8 100644 --- a/app/assets/javascripts/discourse/lib/discourse-location.js.es6 +++ b/app/assets/javascripts/discourse/lib/discourse-location.js.es6 @@ -66,7 +66,8 @@ const DiscourseLocation = Ember.Object.extend({ getURL() { const location = get(this, "location"); let url = location.pathname; - url = url.replace(Discourse.BaseUri, ""); + + url = url.replace(new RegExp(`^${Discourse.BaseUri}`), ""); const search = location.search || ""; url += search;