Merging changes from [5157] into DboSource.

Adding better check in Router::stripEscape()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5160 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-05-23 20:00:16 +00:00
parent eaff06bff6
commit f706d050a4

View file

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