From 1285df896ae0aba111f23a17be502782030e5d69 Mon Sep 17 00:00:00 2001 From: skideh Date: Thu, 19 Jul 2012 00:38:18 -0600 Subject: [PATCH 1/3] Fixed issue where a dynamic/parameter route could not contain a value that was part of the original route. --- path.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/path.js b/path.js index d56a2d8..26bd112 100644 --- a/path.js +++ b/path.js @@ -65,7 +65,9 @@ var Path = { for (i = 0; i < slice.split("/").length; i++) { if ((i < compare.split("/").length) && (slice.split("/")[i].charAt(0) === ":")) { params[slice.split('/')[i].replace(/:/, '')] = compare.split("/")[i]; - compare = compare.replace(compare.split("/")[i], slice.split("/")[i]); + var compare_array = compare.split("/"); + compare_array[i] = slice.split("/")[i]; + compare = compare_array.join("/"); } } } From f371b6c0e63d7f76614dc28a2141a8e29ffc6b90 Mon Sep 17 00:00:00 2001 From: skideh Date: Thu, 19 Jul 2012 00:38:46 -0600 Subject: [PATCH 2/3] Updated tests to reflect fix --- tests/path.js.test.html | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/path.js.test.html b/tests/path.js.test.html index 9d870fa..54d0fc6 100644 --- a/tests/path.js.test.html +++ b/tests/path.js.test.html @@ -2,22 +2,23 @@ PathJS Test - +