PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

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) ""