Bug #75236 [Csd]: infinite loop when printing an error-message
| From: | cmb@php.net | Date: | Thu, 21 Sep 2017 11:12:33 +0000 |
| Subject: | Bug #75236 [Csd]: infinite loop when printing an error-message | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-211301@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75236&edit=1
ID: 75236
Updated by: cmb@php.net
Reported by: lzsiga at freemail dot c3 dot hu
Summary: infinite loop when printing an error-message
Status: Closed
Type: Bug
Package: Reproducible crash
Operating System: AIX, Linux
PHP Version: 7.1.9
Assigned To: ajf
Block user comment: N
Private report: N
New Comment:
Adding htmlentities() support for ISO-8859-2 shouldn't be hard[1], but I'm not
sure whether that would be welcome. I suggest to ask on internals@lists.php.net
first.
[1] <https://lxr.room11.org/xref/php-src%40master/ext/standard/html_tables.h#44>
Previous Comments:
------------------------------------------------------------------------
[2017-09-21 10:28:59] lzsiga at freemail dot c3 dot hu
Thank you for your answer, so here is my next question: should I find out how to make ISO-8859-2 to
be supported, could it be merged into PHP?
------------------------------------------------------------------------
[2017-09-21 10:00:24] cmb@php.net
PHP strings are unaware of the character encoding, so basically any character
encoding is supported. How these are handled exactly depends on the respective
functions/methods. For instance, the character ļ (U+013C, of course!) is not
handled well when given in UTF-16BE encoding to htmlentities():
<?php
var_dump(htmlentities("\x01\x3c", ENT_COMPAT, 'UTF-16BE'));
?>
outputs something like:
Warning: htmlentities(): charset `UTF-16BE' not supported, assuming utf-8
string(5) "<"
If the $encoding parameter is not set, or simply wrong, the result may be
identical, but there may not even be a warning.
It is the developers responsibility to properly deal with character encodings.
------------------------------------------------------------------------
[2017-09-21 09:00:01] lzsiga at freemail dot c3 dot hu
Hi, thank you all for the quick fix!
Speaking of character-encodings, I'd like to ask something: does PHP support any character-seta
that aren't ASCII-compatible (i.e.: there might be a byte between 0x00 and 0x7f that isn't
ASCII-code, but a part of a sequence), like UCS2, UTF-16 or UTF-16? (I really hope the answer is a
'no';)
------------------------------------------------------------------------
[2017-09-20 23:06:36] ajf@php.net
Automatic comment on behalf of ajf@ajf.me
Revision: http://git.php.net/?p=php-src.git;a=commit;h=418f97443aa44644bdf81b96fb726518754724f5
Log: Fix bug #75236
------------------------------------------------------------------------
[2017-09-20 22:18:48] ajf@php.net
Argh, I'm sorry about this, I probably should have tested that fix more than I did.
I'm looking into this now.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=75236
--
Edit this bug report at https://bugs.php.net/bug.php?id=75236&edit=1