Home » File System » File » Bug #5045
File::stripTrailingSeparators should not rtrim the path "/" on linux
Details
| Submitted | 2005-08-09 23:03 UTC |
|---|---|
| From | simeonf at gmail dot com |
| Assigned | mike |
| Status | Closed |
| Package | File |
| PHP Version | 4.3.10 |
| OS | Linux |
| Roadmaps | 1.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) ""