Adding fix for #2613, fixes afterFind callback not called on models in depth search > 1 (recursive).

Changed the regex pattern matching in Router::stripEscape()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5140 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-05-21 03:54:42 +00:00
parent df5c02aa8f
commit 056c4cc054
2 changed files with 4 additions and 3 deletions

View file

@ -778,6 +778,7 @@ class DboSource extends DataSource {
}
}
$this->__mergeAssociation($resultSet[$i], $fetch, $association, $type);
$resultSet[$i][$association] = $linkModel->afterfind($resultSet[$i][$association]);
} else {
$tempArray[0][$association] = false;

View file

@ -737,15 +737,15 @@ class Router extends Object {
}
function stripEscape($param) {
if(is_string($param) || empty($param)) {
$return = preg_replace('/^ ?-!/', '', $param);
$return = preg_replace('/^ *-!/', '', $param);
return $return;
}
foreach($param as $key => $value) {
if(is_string($value)) {
$return[$key] = preg_replace('/^ ?-!/', '', $value);
$return[$key] = preg_replace('/^ *-!/', '', $value);
} else {
foreach ($value as $array => $string) {
$return[$key][$array] = preg_replace('/^ ?-!/', '', $string);
$return[$key][$array] = preg_replace('/^ *-!/', '', $string);
}
}
}