"fixed not shown comments and other properties, if path contained a symlink"

This commit is contained in:
Ralf Becker 2009-03-27 19:03:29 +00:00
parent 9e8ef4d851
commit 881225849d

View File

@ -443,7 +443,7 @@ class vfs_stream_wrapper implements iface_stream_wrapper
{ {
return false; return false;
} }
$scheme2urls[(string)parse_url($url,PHP_URL_SCHEME)][] = $url; $scheme2urls[(string)parse_url($url,PHP_URL_SCHEME)][$path] = $url;
} }
$ret = array(); $ret = array();
foreach($scheme2urls as $scheme => $urls) foreach($scheme2urls as $scheme => $urls)
@ -466,7 +466,14 @@ class vfs_stream_wrapper implements iface_stream_wrapper
{ {
return $r; return $r;
} }
$ret += $r; // we need to re-translate the urls to pathes, as they can eg. contain symlinks
foreach($urls as $path => $url)
{
if (isset($r[$url]) || isset($r[$url=parse_url($url,PHP_URL_PATH)]))
{
$ret[$path] = $r[$url];
}
}
} }
// call the filesystem specific function (dont allow to use arrays!) // call the filesystem specific function (dont allow to use arrays!)
elseif(!function_exists($name) || is_array($pathes)) elseif(!function_exists($name) || is_array($pathes))
@ -726,7 +733,7 @@ class vfs_stream_wrapper implements iface_stream_wrapper
} }
if (!$stat && $check_symlink_components) // check if there's a symlink somewhere inbetween the path if (!$stat && $check_symlink_components) // check if there's a symlink somewhere inbetween the path
{ {
$stat = self::check_symlink_components($path,$flags,$urlx=$url); $stat = self::check_symlink_components($path,$flags,$url);
} }
elseif(is_array($stat) && !isset($stat['url'])) elseif(is_array($stat) && !isset($stat['url']))
{ {