Bug #70897 [Fbk->NoF]: htmlspecialchars() add unnecessary characters.

From: Date: Sun, 22 Nov 2015 04:22:20 +0000
Subject: Bug #70897 [Fbk->NoF]: htmlspecialchars() add unnecessary characters.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197363@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70897&edit=1

 ID:               70897
 Updated by:       php-bugs@lists.php.net
 Reported by:      reject5514 at naver dot com
 Summary:          htmlspecialchars() add unnecessary characters.
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          *General Issues
 Operating System: Arch Linux ARM 4.1.12
 PHP Version:      5.6.15
 Private report:   N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2015-11-12 00:24:55] requinix@php.net

https://3v4l.org/XTslX

I'm not seeing it. Are you sure that's the *exact* output? What if you try

<?php
header('Content-Type: text/plain');
echo
htmlspecialchars('b<>"',ENT_QUOTES|ENT_SUBSTITUTE|ENT_HTML5,'UTF-8');
?>

and in a script all by itself?

------------------------------------------------------------------------
[2015-11-12 00:15:52] reject5514 at naver dot com

Description:
------------
---
From manual page: http://www.php.net/function.htmlspecialchars
---

htmlspecialchars function add unnessary characters after last encoded character if last character is
one of these & < > ' ".


Test script:
---------------
<?php
echo
htmlspecialchars('b<>"',ENT_QUOTES|ENT_SUBSTITUTE|ENT_HTML5,'UTF-8');
?>

Expected result:
----------------
b&lt;&gt;&quot;

Actual result:
--------------
b&lt;&gt;&quot;quot;


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=70897&edit=1


Thread (3 messages)

« previous php.bugs (#197363) next »