Fixes bug described in #3581

Routes with '/**' are now correctly handled by the HtmlHelper->link()
This commit is contained in:
Hikkijp 2014-05-27 14:03:56 -03:00
parent 952c7192f4
commit e6c6e0bf2c
2 changed files with 5 additions and 1 deletions

View file

@ -536,7 +536,10 @@ class CakeRoute {
$out = str_replace($search, $replace, $out); $out = str_replace($search, $replace, $out);
} }
if (strpos($this->template, '*')) { if (strpos($this->template, '**')) {
$out = str_replace('**', $params['pass'], $out);
}
elseif (strpos($this->template, '*')) {
$out = str_replace('*', $params['pass'], $out); $out = str_replace('*', $params['pass'], $out);
} }
$out = str_replace('//', '/', $out); $out = str_replace('//', '/', $out);

View file

@ -334,6 +334,7 @@ class HtmlHelper extends AppHelper {
$escapeTitle = true; $escapeTitle = true;
if ($url !== null) { if ($url !== null) {
$url = $this->url($url); $url = $this->url($url);
$url = str_replace('%2F', '/', $url);
} else { } else {
$url = $this->url($title); $url = $this->url($title);
$title = htmlspecialchars_decode($url, ENT_QUOTES); $title = htmlspecialchars_decode($url, ENT_QUOTES);