EllisLab text mark
Advanced Search
     
form_textarea() helper missing html entity encoding with form_prep()
Posted: 29 August 2007 04:05 AM   [ Ignore ]
Joined: 2007-07-20
1 posts

Great work on Code Igniter.  It’s been a pleasure getting to know it recently.

The reason I’m posting is that I noticed that html entities weren’t getting encoded in my <textarea /> fields.

Here’s a patch to correct that:

--- dist/system/helpers/form_helper.php
+++ fix/system/helpers/form_helper.php    2007-08-29 01:11:56.000000000 -0500
@@ -206,+206,@@
         unset(
$data['value']); // textareas don't use the value attribute
     
}
         
+    $val form_prep($val);
+
     return 
"<textarea ".parse_form_attributes($data$defaults).$extra.">".$val."</textarea>\n";
 

Enjoy.

Just noticed a similar issue with the vals in the form_dropdown() function, by the way.  Added the same form_prep($val) line to correct it.