From: BinaryKitten at jkrswebsolutions dot co dot uk
Operating system: XP SP3
PHP version: 5.2.9
PHP Bug Type: SPL related
Bug description: DirectoryIterator Slash issue with getPathname Windows with
Apache
Description:
------------
When using the DirectoryIterator to go through files/folders on Windows
under apache, the path has a mismatch of \ and /
Reproduce code:
---------------
<?php
$dir = new DirectoryIterator( $_SERVER['DOCUMENT_ROOT'] );
echo "<strong>".$dir->getPath()."</strong><br />";
foreach($dir as $file ) {
$dirName = $file->getPathname();
echo $dirName."<br />";
}
?>
Expected result:
----------------
With the Document root as C:\HTDOCS Apache returns
$_SERVER['DOCUMENT_ROOT'] as c:/HTDOCS
Expected Output
C:/HTDOCS/.
C:/HTDOCS/..
C:/HTDOCS/css
C:/HTDOCS/index.php
C:/HTDOCS/js
C:/HTDOCS/
Actual result:
--------------
C:/HTDOCS\.
C:/HTDOCS\..
C:/HTDOCS\css
C:/HTDOCS\index.php
C:/HTDOCS\js
--
Edit bug report at http://bugs.php.net/?id=48547&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48547&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48547&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48547&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48547&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48547&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48547&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48547&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48547&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48547&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48547&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48547&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48547&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48547&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48547&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48547&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48547&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48547&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48547&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48547&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48547&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48547&r=mysqlcfg