ID: 48547 Comment by: webmaster at asylum-et dot cm Reported By: BinaryKitten at jkrswebsolutions dot co dot uk Status: Open Bug Type: SPL related Operating System: XP SP3 PHP Version: 5.2.9 New Comment:
I have tested this on Windows XP SP3 with PHP 5.2.5 and have the same findings as BinaryKitten at jkrswebsolutions dot co dot uk Previous Comments: ------------------------------------------------------------------------ [2009-06-14 11:47:49] BinaryKitten at jkrswebsolutions dot co dot uk 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 this bug report at http://bugs.php.net/?id=48547&edit=1