mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Removing Router::stripEscape() and all uses of it.
Router::stripEscape() removed escape patterns supported in DboSource. Since those escape patterns no longer exist, neither does the need for the escaping of those patterns.
This commit is contained in:
parent
d70689ecda
commit
a86e414adc
1 changed files with 0 additions and 31 deletions
|
@ -1030,36 +1030,6 @@ class Router {
|
|||
return $base;
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip escape characters from parameter values.
|
||||
*
|
||||
* @param mixed $param Either an array, or a string
|
||||
* @return mixed Array or string escaped
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
function stripEscape($param) {
|
||||
$self =& Router::getInstance();
|
||||
if (!is_array($param) || empty($param)) {
|
||||
if (is_bool($param)) {
|
||||
return $param;
|
||||
}
|
||||
|
||||
return preg_replace('/^(?:[\\t ]*(?:-!)+)/', '', $param);
|
||||
}
|
||||
|
||||
foreach ($param as $key => $value) {
|
||||
if (is_string($value)) {
|
||||
$return[$key] = preg_replace('/^(?:[\\t ]*(?:-!)+)/', '', $value);
|
||||
} else {
|
||||
foreach ($value as $array => $string) {
|
||||
$return[$key][$array] = $self->stripEscape($string);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instructs the router to parse out file extensions from the URL. For example,
|
||||
* http://example.com/posts.rss would yield an file extension of "rss".
|
||||
|
@ -1121,7 +1091,6 @@ class Router {
|
|||
if (empty($param) && $param !== '0' && $param !== 0) {
|
||||
continue;
|
||||
}
|
||||
$param = $self->stripEscape($param);
|
||||
|
||||
$separatorIsPresent = strpos($param, $self->named['separator']) !== false;
|
||||
if ((!isset($options['named']) || !empty($options['named'])) && $separatorIsPresent) {
|
||||
|
|
Loading…
Reference in a new issue