|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63100 array_walk_recursive behaves wrongly when taint enabled
Submitted: 2012-09-17 12:16 UTC Modified: 2012-09-21 06:28 UTC
From: 274611049 at qq dot com Assigned: laruence (profile)
Status: Closed Package: taint (PECL)
PHP Version: 5.3Git-2012-09-17 (Git) OS: Suse Linux
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:
39 - 36 = ?
Subscribe to this entry?

 [2012-09-17 12:16 UTC] 274611049 at qq dot com

Test script:
$a = array();
$a[0] = "tainted string" . "<>";

array_walk_recursive($a, create_function('&$item', '$item = htmlspecialchars($item);'));

echo $a[0];

Expected result:
tainted string&lt;&gt;

Actual result:
Warning: main(): Attempt to echo a string that might be tainted in /usr/local/taint-1.0.0/tests/012.php on line 8
tainted string<> (尖括号没有转义,而且输出了warning)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-17 15:06 UTC]
-Assigned To: +Assigned To: laruence
 [2012-09-18 02:39 UTC]
-Summary: 使用taint后,array_walk_recursive结果有误 +Summary: array_walk_recursive behavior wrongly when enable taint
 [2012-09-18 02:39 UTC]
change summary
 [2012-09-18 02:40 UTC]
-Summary: array_walk_recursive behavior wrongly when enable taint +Summary: array_walk_recursive behaves wrongly when taint enabled
 [2012-09-21 06:28 UTC]
Automatic comment from SVN on behalf of laruence
Log: Fixed bug #63100 (array_walk_recursive behaves wrongly when taint enabled)
 [2012-09-21 06:28 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

 [2012-09-21 06:28 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Sep 26 22:01:23 2020 UTC