mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 17:03:44 +08:00
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;
|
||||
|
||||
|
|
7
test/javascripts/lib/discourse-test.js.es6
Normal file
7
test/javascripts/lib/discourse-test.js.es6
Normal file
|
@ -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
Block a user