FIX: wrong root path on subfolder installs
This commit is contained in:
parent
1821ba8d93
commit
ca98f66f7e
|
@ -14,7 +14,7 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||
if (!url) return url;
|
||||
|
||||
// if it's a non relative URL, return it.
|
||||
if (!/^\/[^\/]/.test(url)) return url;
|
||||
if (url !== '/' && !/^\/[^\/]/.test(url)) return url;
|
||||
|
||||
var u = Discourse.BaseUri === undefined ? "/" : Discourse.BaseUri;
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
module("lib:discourse");
|
||||
|
||||
test("getURL on subfolder install", function() {
|
||||
Discourse.BaseUri = "/forum";
|
||||
equal(Discourse.getURL("/"), "/forum/", "root url has subfolder");
|
||||
equal(Discourse.getURL("/users/neil"), "/forum/users/neil", "relative url has subfolder");
|
||||
});
|
Loading…
Reference in New Issue