maximebf / atomik

Micro framework for PHP 5.3+ [UNMAINTAINED]
MIT License
46 stars 18 forks source link

Windows paths' bug #3

Closed Saacy closed 11 years ago

Saacy commented 11 years ago

Problem: F:\home\dev\atomik/plugins turns into .\F:\home\dev\atomik/plugins

@@ -1890,7 +1891,9 @@

         $relativeTo = $relativeTo ?: self::$rootDirectory;
         $pathname = $filename;
-        if ($filename{0} != '/' && !preg_match('#^[A-Z]:(\\|/)#', $filename)) {
+        if (preg_match('#^[A-Z]:'.addslashes($ds).'#', $filename)) {
+            $pathname = str_replace('/', $ds, $filename);
+        } elseif ($filename{0} != '/') {
             if (strlen($filename) >= 2 && substr($filename, 0, 2) == './') {
                 $filename = substr($filename, 2);
             }
maximebf commented 11 years ago

this bug has been merged in master and will be released with the next point release.

alorence commented 11 years ago

I think this patch has not yet been merged to master. I can't find corresponding commit, and I still have the bug under windows, folowing master branch locally.

maximebf commented 11 years ago

should be fixed in master. the patch is not the same but should fix the issue