#25927 [Opn->Bgs]: get_html_translation_table calls the ' ' instead of '

From: Date: Mon, 20 Oct 2003 22:55:32 +0000
Subject: #25927 [Opn->Bgs]: get_html_translation_table calls the ' ' instead of '
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-49252@lists.php.net to get a copy of this message
ID: 25927 Updated by: iliaa@php.net Reported By: acm at tweakers dot net -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Linux PHP Version: 4.3.3 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Both &#39; and &#039; are valid. Previous Comments: ------------------------------------------------------------------------ [2003-10-20 18:35:41] kees at tweakers dot net We've fixed it be commenting line 421 of ext/standard/html.c: 420- { '\'', "&#039;", 6, ENT_HTML_QUOTE_SINGLE }, 421:/* { '\'', "&#39;", 5, ENT_HTML_QUOTE_SINGLE }, */ ------------------------------------------------------------------------ [2003-10-20 17:53:29] acm at tweakers dot net Description: ------------ When you call get_html_translation_table, with the ENT_QUOTES parameter, it'll return &#39; for ' The code for ' should, of course, be &#039; This was not broken in 4.3.1, so is newly introduced in either 4.3.2 or 4.3.3 One wonders how this could occur, since both htmlspecialchars/htmlentities and html_entity_decode work correctly. Reproduce code: --------------- <? print_r(get_html_translation_table(HTML_SPECIALCHARS,ENT_QUOTES)); ?> Expected result: ---------------- Array ( [&] => &amp; ["] => &quot; ['] => &#039; [<] => &lt; [>] => &gt; ) Actual result: -------------- Array ( [&] => &amp; ["] => &quot; ['] => &#39; [<] => &lt; [>] => &gt; ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25927&edit=1

« previous php.bugs (#49252) next »