[eluser]Unknown[/eluser]
Hi,
I have noticed that HTML entities in default value passed as a second parameter to set_value() are double encoded. I think there should be third parameter allowing to choose wheter second parameter should be passed to form_prep function, because sometimes it's useful, but in my case it's not. Look at the example (let's say there are no POST data, so look only at second parameter):
Code:
<input type="text" name="field" value="<?=set_value('field', 'coffee&tv;')?>" />
set_value returns "coffee&amp;tv" and it is good.
But here is what I want:
Code:
<input type="text" name="2nd_field" value="<?=set_value('2nd_field', 'coffee&tv')?>" />
Again, I would expect that set_value returned "coffee&amp;tv", but now it returns "coffee$amp;amp;tv", so the value I see in the browser is "coffee&amp;tv". I think it would be better if htmlspecialchars in form helper would be called with $double_encode parameter set to false or if there would be a third parameter to set_value. Let me know what do you think.