Permalink
Browse files

Remove rawurldecode from the _parseArgs function in CakeRoute since u…

…rldecode is already called on the URL string in CakeRoute::parse() when creating the $route array that is passed to _parseArgs.

The result of the double urldecodes is parameters with meaningful '%' signs being stripped away on accident, and the web server reporting that the requested address doesn't exist.
  • Loading branch information...
Melvin.Ross@gmail.com
Melvin.Ross@gmail.com committed Jan 24, 2014
1 parent ddf046a commit 8d6814e63f115d2887f84d4359993b9711c51728
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/Cake/Routing/Route/CakeRoute.php
@@ -297,12 +297,12 @@ protected function _parseArgs($args, $context) {
$separatorIsPresent = strpos($param, $namedConfig['separator']) !== false;
if ((!isset($this->options['named']) || !empty($this->options['named'])) && $separatorIsPresent) {
list($key, $val) = explode($namedConfig['separator'], $param, 2);
- $key = rawurldecode($key);
- $val = rawurldecode($val);
+ $key = key;
+ $val = $val;
$hasRule = isset($rules[$key]);
$passIt = (!$hasRule && !$greedy) || ($hasRule && !$this->_matchNamed($val, $rules[$key], $context));
if ($passIt) {
- $pass[] = rawurldecode($param);
+ $pass[] = $param;
} else {
if (preg_match_all('/\[([A-Za-z0-9_-]+)?\]/', $key, $matches, PREG_SET_ORDER)) {
$matches = array_reverse($matches);
@@ -323,7 +323,7 @@ protected function _parseArgs($args, $context) {
$named = array_merge_recursive($named, array($key => $val));
}
} else {
- $pass[] = rawurldecode($param);
+ $pass[] = $param;
}
}
return array($pass, $named);

0 comments on commit 8d6814e

Please sign in to comment.