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 #5045

File::stripTrailingSeparators should not rtrim the path "/" on linux

Details

Submitted2005-08-09 23:03 UTC
Fromsimeonf at gmail dot com
Assignedmike
StatusClosed
PackageFile
PHP Version4.3.10
OSLinux
Roadmaps1.3.0a1

Comments

[2005-08-09 23:03 UTC] simeonf at gmail dot com

Description:
------------
On linux, "/" is a valid path representing the root. File::stripTrailingSeparators should not rtrim the path if it consists of "/" and $seperator = "/". For all other paths, "/my/path/to/dir/foo/" is the same as "/my/path/to/dir/foo", but "/" != "".

Test script:
---------------
<?php
include "File.php";
var_dump(File::stripTrailingSeparators("/"));
?>

Expected result:
----------------
string(1) "/"

Actual result:
--------------
string(0) ""