|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12158 EVAL code not working correctly if IF block
Submitted: 2001-07-13 20:58 UTC Modified: 2001-07-17 11:53 UTC
From: craig at nerds dot net Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0.6 OS: Win2K
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:
23 + 48 = ?
Subscribe to this entry?

 [2001-07-13 20:58 UTC] craig at nerds dot net


for ($i=0;$i<=$numargs-1;$i++){	
	if ($numargs>0 && $i!=$numargs-1){
		$x=$x." || ";
echo $validExtensions;


while (($filename = readdir($handle))!==false) {
if (is_file($filename)){
	$fd = fopen ($filename, "rb");
	$contents = fread ($fd, filesize ($filename));

		if (eval($validExtensions)){
				echo $filename."<br>";

	fclose ($fd);





Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-17 11:53 UTC]
The code you get is:

strstr($filename,".htm") || strstr($filename,".asp")

this is not a valid code block for eval. If you add "return " before it and ";" after it, it should work then. 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 08:01:25 2023 UTC