php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7756 Problems w/include ""
Submitted: 2000-11-11 00:47 UTC Modified: 2000-11-11 05:09 UTC
From: bens at benjamindsmith dot com Assigned:
Status: Closed Package: *Function Specific
PHP Version: 4.0.3pl1 OS: RH 6.2
Private report: No CVE-ID: None
 [2000-11-11 00:47 UTC] bens at benjamindsmith dot com
Executing the following code 

<? 
$a=""; 

if (false===include ($a))
	{ 
	echo "Couldn't include file"; 
	// error handling
	} 
else 
	{ 
	echo "file found!"; 
	// all is well... 
	} 
?> 

causes the script to crash instead of allowing me to trap the error. This could be fixed with a simple input sanity check in the include function! 

I see that you've already seen this bug in a different form http://bugs.php.net/bugs.php?id=6743 but this didn't address the problem given here. 

Include is a function like any other, and if it fails, the script shouldn't cause all action to stop. It,  like any other function, should return false and should be trapable in the code above. 

Thanks!  

-Ben 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-11 05:09 UTC] hholzgra@php.net
fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 09:01:28 2024 UTC