mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Removed comparison method
This commit is contained in:
parent
1202658396
commit
5e896aa94a
1 changed files with 3 additions and 14 deletions
|
@ -518,10 +518,10 @@ class CakeRoute {
|
||||||
$out = $this->template;
|
$out = $this->template;
|
||||||
|
|
||||||
$search = $replace = array();
|
$search = $replace = array();
|
||||||
$keys = $this->keys;
|
|
||||||
|
|
||||||
// Sort the keys in reverse order by length to prevent mismatches
|
$lengths = array_map('strlen', $this->keys);
|
||||||
uasort($keys, array($this, '_sortKeys'));
|
$keys = array_combine($lengths, $this->keys);
|
||||||
|
krsort($keys);
|
||||||
|
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
$string = null;
|
$string = null;
|
||||||
|
@ -542,15 +542,4 @@ class CakeRoute {
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Comparison method for sorting keys in reverse order by length.
|
|
||||||
*
|
|
||||||
* @param $a
|
|
||||||
* @param $b
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
protected function _sortKeys($a, $b) {
|
|
||||||
return strlen($a) > strlen($b) ? -1 : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue