|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
24 + 6 = ?
Subscribe to this entry?

 [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: Tue Apr 23 17:01:31 2024 UTC