|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67869 FILTER_SANITIZE_FULL_SPECIAL_CHARS returns MB4-Chars incorrectly
Submitted: 2014-08-20 08:00 UTC Modified: 2020-06-04 12:38 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: heurika at gmail dot com Assigned:
Status: Open Package: Filter related
PHP Version: 5.5.15 OS: Debian 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: heurika at gmail dot com
New email:
PHP Version: OS:


 [2014-08-20 08:00 UTC] heurika at gmail dot com
The function FILTER_SANITIZE_FULL_SPECIAL_CHARS doesn't returns the chars equivalent to calling htmlspecialchars() with ENT_QUOTES set. 

default_charset = "utf-8" 

Test script:
$string = '?';

echo 'filter_var: ' . filter_var($string, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . PHP_EOL;
echo 'htmlspecialchars: ' . htmlspecialchars($string, ENT_QUOTES);

Expected result:
filter_var: ?
htmlspecialchars: ?

Actual result:
filter_var: �
htmlspecialchars: ?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-18 13:32 UTC]
I can't reproduce the issue, see <>.
 [2020-06-04 12:38 UTC]
Can anybody else reproduce this with any of the actively supported
PHP versions[1]?

[1] <>
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Nov 28 08:01:23 2020 UTC