PHP 4.0 Bug #8018: get_html_translation_table() produces wrong conversion
| From: | urs at circle dot ch | Date: | Tue, 28 Nov 2000 22:27:44 +0000 |
| Subject: | PHP 4.0 Bug #8018: get_html_translation_table() produces wrong conversion | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-39419@lists.php.net to get a copy of this message | ||
From: urs@circle.ch
Operating system: Win2k
PHP version: 4.0 Latest CVS (28/11/2000)
PHP Bug Type: Strings related
Bug description: get_html_translation_table() produces wrong conversion
dear all
while using get_html_translation_table() i recognized a wrong conversion of the "&"
character to "'" instead of "&".
could this confirm someone?
<?php
$str = "Hallo & <Pallo> & küßchen & ö & ä & à";
$trans = get_html_translation_table(HTML_SPECIALCHARS);
echo strtr($str, $trans) . "<br>\n"; // output: Hallo ' <Pallo>
' küßchen ' ö ' ä ' à
echo htmlspecialchars($str) . "<br>\n"; // output: Hallo & <Pallo>
& küßchen & ö & ä & à
echo htmlentities($str) . "<br>\n"; // output: Hallo & <Pallo>
& küßchen & ö & ä & à
?>
--
Urs Gehrig <urs@circle.ch>
http://www.circle.ch
--
Edit Bug report at: http://bugs.php.net/?id=8018&edit=1