From 9734403114b95ff3c02ac12af7a58fe8e94a8da1 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 9 Jun 2014 12:21:58 +0700 Subject: [PATCH] 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 ``` --- public/src/ajaxify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index b1d63f7141..7fafaa4457 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -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;