1
0
Fork 0

Tentative fix for *nix

pull/142/head
Jordi Boggiano 2011-12-04 18:44:40 +01:00
parent 4517a2e51e
commit a19695cdcb
1 changed files with 3 additions and 3 deletions

View File

@ -61,12 +61,12 @@ class Filesystem
$from = rtrim(strtr($from, '\\', '/'), '/');
$to = rtrim(strtr($to, '\\', '/'), '/');
$commonPath = dirname($to);
while (strpos($from, $commonPath) !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/$}i', $commonPath)) {
$commonPath = strtr(dirname($to), '\\', '/');
while (strpos($from, $commonPath) !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) {
$commonPath = strtr(dirname($commonPath), '\\', '/');
}
if (0 !== strpos($from, $commonPath) || '/' === $commonPath) {
if (0 !== strpos($from, $commonPath) || '/' === $commonPath || '.' === $commonPath) {
return $to;
}