mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
Fix removeRelativePath
Instead of checking the existence of relative_path (without /) anywhere on the url, it really should check that the url only starts with the relative_path. Example ``` relative_path = /forum without / = forum url = /category/forum/5 removeRelativePath = ory/forum/5 ```
This commit is contained in:
@@ -123,7 +123,7 @@ var ajaxify = ajaxify || {};
|
||||
};
|
||||
|
||||
function removeRelativePath(url) {
|
||||
if (url.indexOf(RELATIVE_PATH.slice(1)) !== -1) {
|
||||
if (url.indexOf(RELATIVE_PATH.slice(1)) === 0) {
|
||||
url = url.slice(RELATIVE_PATH.length);
|
||||
}
|
||||
return url;
|
||||
|
||||
Reference in New Issue
Block a user