Permalink
Browse files

Fixed key sorting

  • Loading branch information...
1 parent 5e896aa commit 17652575f33a9b1494eb99de3b95a25bdf2e7e37 Mike Gibson committed Mar 10, 2014
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/Cake/Routing/Route/CakeRoute.php
@@ -520,8 +520,9 @@ protected function _writeUrl($params) {
$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;

0 comments on commit 1765257

Please sign in to comment.