Bug #68728 [Opn]: htmlentities() does not convert ' '/" to  /" with ENT_HTML5

From: Date: Wed, 11 Feb 2015 01:46:03 +0000
Subject: Bug #68728 [Opn]: htmlentities() does not convert ' '/" to  /" with ENT_HTML5
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190576@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68728&edit=1 ID: 68728 Updated by: yohgaki@php.net Reported by: yohgaki@php.net Summary: htmlentities() does not convert ' '/" to &nbsp;/&quot; with ENT_HTML5 Status: Open Type: Bug Package: Unknown/Other Function Operating System: any PHP Version: Irrelevant -Assigned To: +Assigned To: yohgaki Block user comment: N Private report: N New Comment: I've proposed this change once. I may try it again. Previous Comments: ------------------------------------------------------------------------ [2015-02-10 20:47:11] ppaisndud at gmail dot com This line causes this, https://github.com/php/php-src/blob/master/ext/standard/html.c#L1316-L1318 probably can be moved to verified if it is a error. ------------------------------------------------------------------------ [2015-01-03 01:25:53] yohgaki@php.net Description: ------------ ' ' space is &nbsp and it's in conversion tables. localhost:Documents yohgaki$ php -r 'print_r(get_html_translation_table(ENT_HTML5));' Array ( ["] => &quot; [&] => &amp; [<] => &lt; [>] => &gt; [ ] => &nbsp; [¡] => &iexcl; but ' '/" is not converted to &nbsp;/&quot; with htmlentities() at least. " is converted to &quot; with additional ENT_QUOTES flag. However, htmlentities() should convert all chars according to the conversion table. Test script: --------------- php -r 'echo htmlentities("\" <>?&/", ENT_HTML5);' Expected result: ---------------- &quot;&nbsp;&lt;&gt;&quest;&amp;&sol; Actual result: -------------- " &lt;&gt;&quest;&amp;&sol; ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68728&edit=1

« previous php.bugs (#190576) next »