Skip to content

Commit

Permalink
Removing Router::stripEscape() and all uses of it.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
markstory committed Nov 29, 2009
1 parent d70689e commit a86e414
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions cake/libs/router.php
Expand Up @@ -1030,36 +1030,6 @@ function stripPlugin($base, $plugin = null) {
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".
Expand Down Expand Up @@ -1121,7 +1091,6 @@ function getArgs($args, $options = array()) {
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) {
Expand Down

0 comments on commit a86e414

Please sign in to comment.