Home » HTML » HTML_QuickForm » Bug #7888
setDefaults() eats backslashes
Details
| Submitted | 2006-06-13 16:18 UTC |
|---|---|
| From | leonard-php-bugzilla at ottolander dot nl |
| Status | Bogus |
| Package | HTML_QuickForm |
| PHP Version | 4.3.2 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-06-13 16:18 UTC] leonard-php-bugzilla at ottolander dot nl
Description:
------------
When assigning strings to text and textarea fields using setDefaults backslashes are "eaten". This is only obvious with sequences of multiple backslashes. About half of the backslashes disappear from the input field (as if they were escaped). Using addslashes() before assigning does not help as this will also escape quotes, which then appear with an added backslash.
The only way to fix this is to add a
preg_replace('/(\\\\)/', "\\\\\\\\", $fieldvalue);
for *every* setDefaults() assignment.
[2006-06-14 19:40 UTC] leonard-php-bugzilla at ottolander dot nl
Yes, this is a false alarm, caused by the use of HTML_Template_IT. The (undocumented) default setting of use_preg to true is the cause of the disappearing backslashes.