From 17652575f33a9b1494eb99de3b95a25bdf2e7e37 Mon Sep 17 00:00:00 2001 From: Mike Gibson Date: Mon, 10 Mar 2014 13:09:19 +0000 Subject: [PATCH] Fixed key sorting --- lib/Cake/Routing/Route/CakeRoute.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Routing/Route/CakeRoute.php b/lib/Cake/Routing/Route/CakeRoute.php index 48539b2d0..e12bff243 100644 --- a/lib/Cake/Routing/Route/CakeRoute.php +++ b/lib/Cake/Routing/Route/CakeRoute.php @@ -520,8 +520,9 @@ class CakeRoute { $search = $replace = array(); $lengths = array_map('strlen', $this->keys); - $keys = array_combine($lengths, $this->keys); - krsort($keys); + $flipped = array_combine($this->keys, $lengths); + arsort($flipped); + $keys = array_flip($flipped); foreach ($keys as $key) { $string = null;