Re: [PHP-DEV] [PATCH] Bug #43896 htmlspecialchars returns empty string on invalid unicode sequence

2008-01-26 Thread Tomas Kuliavas
>> Instead of using simple sanitizing function users are forced to check >> for errors. How good is that? It makes code complex or unreliable. > > Explain me again how checking for errors makes code unreliable? OR unreliable. If you check for errors, sanitizing code is complex. If you don't check

Re: [PHP-DEV] [PATCH] Bug #43896 htmlspecialchars returns empty string on invalid unicode sequence

2008-01-26 Thread Stanislav Malyshev
Instead of using simple sanitizing function users are forced to check for errors. How good is that? It makes code complex or unreliable. Explain me again how checking for errors makes code unreliable? -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)25

Re: [PHP-DEV] [PATCH] Bug #43896 htmlspecialchars returns empty string on invalid unicode sequence

2008-01-26 Thread Arnaud.lb
> > Should really theses functions discard the whole string for a single > > incomplete sequence ? > > I think since it is not possible to recover true content of the string, > it is ok to return failure value. Cutting it in random places or > ignoring problems doesn't seem a good idea - it mig

Re: [PHP-DEV] [PATCH] Bug #43896 htmlspecialchars returns empty string on invalid unicode sequence

2008-01-25 Thread Tomas Kuliavas
>> Should really theses functions discard the whole string for a single >> incomplete sequence ? > > I think since it is not possible to recover true content of the string, > it is ok to return failure value. Cutting it in random places or > ignoring problems doesn't seem a good idea - it might lea

Re: [PHP-DEV] [PATCH] Bug #43896 htmlspecialchars returns empty string on invalid unicode sequence

2008-01-25 Thread Stanislav Malyshev
Should really theses functions discard the whole string for a single incomplete sequence ? I think since it is not possible to recover true content of the string, it is ok to return failure value. Cutting it in random places or ignoring problems doesn't seem a good idea - it might lead to all

[PHP-DEV] [PATCH] Bug #43896 htmlspecialchars returns empty string on invalid unicode sequence

2008-01-24 Thread Arnaud.lb
Hi, The htmlspecialchars and htmlentities functions since version 5.2.5 return an empty string when the input contains at least a single invalid or incomplete unicode sequence. What I understood is that this change was made to avoid reading more chars in the buffer than it actually contained.