Skip to content

Commit

Permalink
Fixed key sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdigital committed Mar 10, 2014
1 parent 5e896aa commit 1765257
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Cake/Routing/Route/CakeRoute.php
Expand Up @@ -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;
Expand Down

0 comments on commit 1765257

Please sign in to comment.