mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 15:48:55 +01:00
Fixed follow option in find():
- if base is a symlink to a dir, this one is listed anyway - symlinks to dirs (beside the base) are only descended, if $options['follow'] is specified - links are returned for type 'f' --> removed follow option from find() in filemanager_ui::get_rows() --> no more infinit symlink loops in filemanager GUI
This commit is contained in:
parent
0dd58f3038
commit
287131565f
@ -570,7 +570,6 @@ class filemanager_ui
|
||||
'limit' => (int)$query['num_rows'].','.(int)$query['start'],
|
||||
'need_mime' => true,
|
||||
'name_preg' => $namefilter,
|
||||
'follow' => true, // follow symlinks
|
||||
),true) as $path => $row)
|
||||
{
|
||||
//echo $path; _debug_array($row);
|
||||
|
@ -388,11 +388,11 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
{
|
||||
if (!$url) $path = egw_vfs::PREFIX . $path;
|
||||
|
||||
$is_dir = is_dir($path) && ($options['follow'] || !is_link($path));
|
||||
if (!isset($options['remove']))
|
||||
{
|
||||
$options['remove'] = count($base) == 1 ? count(explode('/',$path))-3+(int)(substr($path,-1)!='/') : 0;
|
||||
}
|
||||
$is_dir = is_dir($path);
|
||||
if ((int)$options['mindepth'] == 0 && (!$dirs_last || !$is_dir))
|
||||
{
|
||||
self::_check_add($options,$path,$result);
|
||||
@ -409,7 +409,8 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
{
|
||||
self::_check_add($options,$file,$result);
|
||||
}
|
||||
if (is_dir($file) && (!isset($options['maxdepth']) || $options['maxdepth'] > 1))
|
||||
// only descend into subdirs, if it's a real dir (no link to a dir) or we should follow symlinks
|
||||
if (is_dir($file) && ($options['follow'] || !is_link($file)) && (!isset($options['maxdepth']) || $options['maxdepth'] > 1))
|
||||
{
|
||||
$opts = $options;
|
||||
if ($opts['mindepth']) $opts['mindepth']--;
|
||||
@ -509,7 +510,7 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
{
|
||||
$type = $options['type']; // 'd' or 'f'
|
||||
|
||||
if ($type && ($type == 'd') !== is_dir($path))
|
||||
if ($type && ($type == 'd') !== (is_dir($path) && !is_link($path)))
|
||||
{
|
||||
return; // wrong type
|
||||
}
|
||||
@ -525,7 +526,6 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
{
|
||||
$stat['mime'] = self::mime_content_type($path);
|
||||
}
|
||||
|
||||
if (isset($options['name_preg']) && !preg_match($options['name_preg'],$stat['name']) ||
|
||||
isset($options['path_preg']) && !preg_match($options['path_preg'],$path))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user