| Bug #47494 | htmlspecialchars does not throw E_WARNING on multibyte problems | ||||
|---|---|---|---|---|---|
| Submitted: | 24 Feb 2009 1:57pm UTC | Modified: | 20 Nov 2009 8:24pm UTC | ||
| From: | philipp dot feigl at gmail dot com | Assigned to: | |||
| Status: | Bogus | Category: | Strings related | ||
| Version: | 5.2.8 | OS: | CentOS5 | ||
[24 Feb 2009 1:57pm UTC] philipp dot feigl at gmail dot com
[25 Feb 2009 1:48pm UTC] jani@php.net
It's intentional. If you disagree, please ask stas@php.net why it is like this (I once reverted that :)
[20 Nov 2009 8:24pm UTC] stas@php.net
The idea is to return an error but not display it (i.e. log it or allow custom error handlers to process it). The reason for it is that, unfortunately, people run servers in production with display_errors=On, and php_escape_html_entities_ex can be triggered from all kinds of code that usually doesn't produce errors, which can reveal sensitive information on public sites. So we chose to go after lesser of two evils and not generate the error in this context. For debugging, I would suggest always logging errors and checking the error log, as some errors may be hard to spot in display anyway (especially true if your script produces something like JSON).
