mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
9308974f8c
The purpose of mbstring is for working with Unicode and legacy text encodings; but Base64, QPrint, etc. are not text encodings and don't really belong in mbstring. PHP already contains separate implementations of Base64, QPrint, and HTML entities. It will be better to eventually remove these non-encodings from mbstring. Regarding HTML entities... there is a bit more to say. mbstring's implementation of HTML entities is different from the other built-in implementation (htmlspecialchars and htmlentities). Those functions convert <, >, and & to HTML entities, but mbstring does not. It appears that the original author of mbstring intended for something to be done with <, >, and &. He used a table to identify which characters should be converted to HTML entities, and </>/& all have a special value in that table. However, nothing ever checks for that special value, so the characters are passed through unconverted. This seems like a very useless implementation of HTML entities. The most important characters which need to be expressed as entities in HTML documents are those three!
13 lines
389 B
PHP
13 lines
389 B
PHP
--TEST--
|
|
Bug #71606 (Segmentation fault mb_strcut + mb_list_encodings)
|
|
--EXTENSIONS--
|
|
mbstring
|
|
--FILE--
|
|
<?php
|
|
echo mb_strcut('"', 0, 0, 'HTML-ENTITIES');
|
|
echo 'DONE', PHP_EOL;
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: mb_strcut(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in %s on line %d
|
|
DONE
|