php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40546 SplFileInfo::getPathInfo() throws an execption if directory is in root dir.
Submitted: 2007-02-19 19:54 UTC Modified: 2007-02-19 21:19 UTC
From: info at adaniels dot nl Assigned: helly (profile)
Status: Closed Package: SPL related
PHP Version: 5.2.1 OS: Linux/Ubuntu
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: info at adaniels dot nl
New email:
PHP Version: OS:

 

 [2007-02-19 19:54 UTC] info at adaniels dot nl
Description:
------------
SplFileInfo::getPathInfo() throws an execption if directory is in root dir.

Reproduce code:
---------------
<?php
	$fi = new SplFileInfo('/home');
	echo $fi->getPathInfo()->getFilename();
?>

Expected result:
----------------
/

Actual result:
--------------
Fatal error: Uncaught exception 'RuntimeException' with message 'Cannot create SplFileInfo for empty path' in /home/arnold/projects/jasny/jasny-explorer/webroot/index.php:6 Stack trace: #0 /home/arnold/projects/jasny/jasny-explorer/webroot/index.php(6): SplFileInfo->getPathInfo() #1 {main} thrown in /home/arnold/projects/jasny/jasny-explorer/webroot/index.php on line 6

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-19 21:05 UTC] helly@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.
 [2007-02-19 21:19 UTC] info at adaniels dot nl
Wow, thats fast...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC