#6071: HtmlHelper's escape option wrongly unset
--------------------------------------------+-------------------------------
Reporter: headache | Type: Bug
Status: new | Priority: Low
Milestone: 1.2.x.x | Component: Helpers
Version: 1.2 Final | Severity: Normal
Keywords: html,link,htmlhelper,escape | Php_version: n/a
Cake_version: 1.2.1.8004 |
--------------------------------------------+-------------------------------
Though HtmlHelper::link() has an $escapeTitile param it has no effect on
the htmlAttributes array values. This seems correct. However, the method
(wrongly, IMO) also checks the $htmlAttributes array for an 'escape'
option. If it is set, the title will also be escaped. Fair enough--I
suspect that this behavior exists because the devs want to push most
method params into arrays as options.
The problem is, the method then unsets the 'escape' option, so any
attributes which need escaping will not get it when they're sent through
Helper::_parseAttributes().
{{{
if (isset($htmlAttributes['escape'])) {
$escapeTitle = $htmlAttributes['escape'];
unset($htmlAttributes['escape']); // <--- why?!
}
}}}
Why unset that option? $title and $htmlAttributes go their separate ways
after this so it can't be that $title might possibly be double-escaped if
that option is left set.
I consider this is a bug although, if there's a good reason for this that
I've missed, I'd be happy to call it an enhancement.
--
Ticket URL: <https://trac.cakephp.org/ticket/6071>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---