Fixing changes made in commit 522446e to works with PHP 5.2-. Refs #974

This commit is contained in:
Juan Basso 2010-08-01 02:55:30 -03:00
parent 509a9e14e2
commit 7e7a2c57e2

View file

@ -1351,10 +1351,11 @@ class CakeRoute {
$route = $this->template;
$names = $routeParams = array();
$parsed = preg_quote($this->template, '#');
$parsed = str_replace('\\-', '-', $parsed);
preg_match_all('#:([A-Za-z0-9_-]+[A-Z0-9a-z])#', $this->template, $namedElements);
preg_match_all('#:([A-Za-z0-9_-]+[A-Z0-9a-z])#', $parsed, $namedElements);
foreach ($namedElements[1] as $i => $name) {
$search = '\\' . str_replace('-', '\\-', $namedElements[0][$i]);
$search = '\\' . $namedElements[0][$i];
if (isset($this->options[$name])) {
$option = null;
if ($name !== 'plugin' && array_key_exists($name, $this->defaults)) {