php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14741 is_file returns an error rather than if a file exists or not
Submitted: 2001-12-28 13:14 UTC Modified: 2001-12-28 13:31 UTC
From: watford at uiuc dot edu Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.1.0 OS: FreeBSD 4.3
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: watford at uiuc dot edu
New email:
PHP Version: OS:

 

 [2001-12-28 13:14 UTC] watford at uiuc dot edu
<?php
	if(is_file($_GET['file'].".php")) { include($_GET['file'].".php"); }
	elseif(is_file($_GET['focus'].".inc")) { virtual($_GET['focus'].".inc"); }
	else { virtual("news/news.inc"); }
?>

That code throws this error:

Warning: stat failed for .php (errno=2 - No such file or directory) in /usr/home/edgewww/helpandsupport.net/cs/htdocs/index.php on line 39

Warning: stat failed for .inc (errno=2 - No such file or directory) in /usr/home/edgewww/helpandsupport.net/cs/htdocs/index.php on line 40

I've corrected this issue by using file_exists but for the sake of not having to change my backend, I'd love for is_file to start working again.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-28 13:31 UTC] mfischer@php.net
This has been fixed in 4.1.1 . Closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 18:01:34 2024 UTC