[php-src] Issue #11527: get_html_translation_table() inconsistent results with ENT_XHTML?
| From: | pine3ree | Date: | Sat, 24 Jun 2023 21:02:31 +0000 |
| Subject: | [php-src] Issue #11527: get_html_translation_table() inconsistent results with ENT_XHTML? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-244807@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11527
Author: pine3ree
### Description
The following code:
```php
<?php
print_r(get_html_translation_table(HTML_SPECIALCHARS, ENT_QUOTES | ENT_SUBSTITUTE | ENT_XHTML,
"UTF-8"));
print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES | ENT_SUBSTITUTE | ENT_XHTML,
"UTF-8"));
```
Resulted in this output:
```
Array
(
["] => "
[&] => &
['] => '
[<] => <
[>] => >
)
Array
(
["] => "
[&] => &
['] => '
[<] => <
[>] => >
[ ] =>
// ...
// ...
)
```
But I expected the specialchars table to be a subset of the entities table. The single quotes in the
entities table is substituted using the decimal notation, while it uses the html5 named entity
notation in the specialchars table.
### PHP Version
PHP 5.4 to PHP 8.2
### Operating System
mint/ubuntu 22.04