|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68582 filter_var_array ignores FILTER_FLAG_NO_ENCODE_QUOTES
Submitted: 2014-12-09 22:45 UTC Modified: 2014-12-17 00:01 UTC
From: jasonpowellux at gmail dot com Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.6.3 OS: Centos 6.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jasonpowellux at gmail dot com
New email:
PHP Version: OS:


 [2014-12-09 22:45 UTC] jasonpowellux at gmail dot com
From manual page:

Test script:
// input an apostrophe or quote in the form below & it will get encoded in the first two var_dump commands, but not the third


var_dump($cleanPOST1); echo "<br>"; //will make an apostrophe 5 chars i.e encode it
var_dump($cleanPOST2); echo "<br>"; //will make an apostrophe 5 chars i.e encode it
var_dump(filter_var($_POST['text'],FILTER_SANITIZE_STRING,FILTER_FLAG_NO_ENCODE_QUOTES)); // won't encode
<form action="test.php" enctype="multipart/form-data" method="post">
	<input type="text" name="text">

Expected result:
array(1) { ["text"]=> string(1) """ }
array(1) { ["text"]=> string(1) """ }
string(1) """ 

Actual result:
array(1) { ["text"]=> string(5) """ }
array(1) { ["text"]=> string(5) """ }
string(1) """ 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-12-09 22:47 UTC] jasonpowellux at gmail dot com
-: jasonpwoellux at gmail dot com +: jasonpowellux at gmail dot com
 [2014-12-09 22:47 UTC] jasonpowellux at gmail dot com
email address corrected
 [2014-12-17 00:01 UTC]
-Status: Open +Status: Not a bug
 [2014-12-17 00:01 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Please see the documentation.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 13 16:01:31 2024 UTC