|  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
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: craig at nerds dot net
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 20:01:31 2024 UTC