PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File System » File » Bug #4911

Bad test in File_Util::isAbsolute

Details

Submitted2005-07-25 18:22 UTC
Fromkars at kde dot nl
Assignedmike
StatusClosed
PackageFile
PHP Version4.4.0
OSLinux
Roadmaps(Not assigned)

Comments

[2005-07-25 18:22 UTC] kars at kde dot nl

Description:
------------
I was browsing through File/Util.php on my Linux box with PHP 4.4.0, and noticed that isAbsolute considers a path that contains two periods -anywhere- in the path as a relative path.

It's still there in CVS for as far as I can tell, on line 179.

Test script:
---------------
require_once ('File/Util.php');

$filename = '/pub/audio/misc/Just... a song.mp3';
if (File_Util::isAbsolute($filename)) {
echo "'$filename' is absolute.";
} else {
echo "'$filename' is relative.";
}

Expected result:
----------------
The test should produce:
'/pub/audio/misc/Just... a song.mp3' is absolute.

Actual result:
--------------
What I got was:
'/pub/audio/misc/Just... a song.mp3' is relative.