#6016: $form->textarea always always escapes value
---------------------------------------+------------------------------------
    Reporter:  ruzz                    |          Type:  Bug    
      Status:  new                     |      Priority:  Low    
   Milestone:  1.2.x.x                 |     Component:  Helpers
     Version:  RC2                     |      Severity:  Normal 
    Keywords:  form, textarea, escape  |   Php_version:  n/a    
Cake_version:                          |  
---------------------------------------+------------------------------------
 '''Issue:'''

 When creating a form text area using the form helper textareas are always
 pushed through the h function to escape htmlspecialchars, regardless of if
 the escape option is passed.
 [[BR]][[BR]]


 '''Example:'''
 {{{
 $form->textarea('inputName', array('escape' => false);
 }}}

 after tracing code it seems there is a bad if statement in form::textarea
 the offending code is:

 {{{
 if (!array_key_exists('escape', $options) || $options['escape'] !== false)
 {
 }}}

 note the invalid '''!==''' which always resolves as the condition as true
 causing the if block to be executed.
 [[BR]][[BR]]


 '''fix'''
 {{{
 if (!array_key_exists('escape', $options) || $options['escape'] != false)
 {
 }}}
 [[BR]][[BR]]


 '''affected versions:'''

 1.2.0.7296 RC2
 and, from a quick view of the trac, all later versions as well.
 [[BR]]
 [[BR]]

 '''introduced in:'''[[BR]]

 https://trac.cakephp.org/changeset/5778

-- 
Ticket URL: <https://trac.cakephp.org/ticket/6016>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to