PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #7888

setDefaults() eats backslashes

Details

Submitted2006-06-13 16:18 UTC
Fromleonard-php-bugzilla at ottolander dot nl
StatusBogus
PackageHTML_QuickForm
PHP Version4.3.2
OSLinux
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.