Skip to content

Commit

Permalink
Fixes bug described in #3581
Browse files Browse the repository at this point in the history
Routes with '/**' are now correctly handled by the HtmlHelper->link()
  • Loading branch information
henriquebremenkanp committed May 27, 2014
1 parent 952c719 commit e6c6e0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Cake/Routing/Route/CakeRoute.php
Expand Up @@ -536,7 +536,10 @@ protected function _writeUrl($params) {
$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('//', '/', $out);
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/View/Helper/HtmlHelper.php
Expand Up @@ -334,6 +334,7 @@ public function link($title, $url = null, $options = array(), $confirmMessage =
$escapeTitle = true;
if ($url !== null) {
$url = $this->url($url);
$url = str_replace('%2F', '/', $url);
} else {
$url = $this->url($title);
$title = htmlspecialchars_decode($url, ENT_QUOTES);
Expand Down

0 comments on commit e6c6e0b

Please sign in to comment.