FIX: subfolder redirects to wrong URL if the subfolder appears in the slug

This commit is contained in:
Neil Lalonde 2018-08-08 13:41:29 -04:00
parent 94622b451a
commit 35bef72d4e

View File

@ -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;