fix whole directories where not cleaned up, when deleting old versions and deleted files, changed .versions dir to only contain older versions (no longer deleted files / stuff from .attic too)

This commit is contained in:
Ralf Becker 2016-01-21 14:35:45 +00:00
parent 2a77e523f5
commit b4a20773b8
2 changed files with 11 additions and 4 deletions

View File

@ -245,8 +245,10 @@ class StreamWrapper implements StreamWrapperIface
{ {
self::load_wrapper($scheme); self::load_wrapper($scheme);
} }
$url = Vfs::concat($url,substr($parts['path'],strlen($mounted))); if (($relative = substr($parts['path'],strlen($mounted))))
{
$url = Vfs::concat($url,$relative);
}
// if url contains url parameter, eg. from filesystem streamwrapper, we need to append relative path here too // if url contains url parameter, eg. from filesystem streamwrapper, we need to append relative path here too
$matches = null; $matches = null;
if ($fix_url_query && preg_match('|([?&]url=)([^&]+)|', $url, $matches)) if ($fix_url_query && preg_match('|([?&]url=)([^&]+)|', $url, $matches))

View File

@ -180,12 +180,17 @@ class filemanager_admin extends filemanager_ui
Vfs::find($content['versionedpath'], array( Vfs::find($content['versionedpath'], array(
'show-deleted' => true, 'show-deleted' => true,
'hidden' => true, 'hidden' => true,
'path_preg' => '#/\.versions/#', 'depth' => true,
'path_preg' => '#/\.(attic|versions)/#',
)+(!(int)$content['ctime'] ? array() : array( )+(!(int)$content['ctime'] ? array() : array(
'ctime' => ($content['ctime']<0?'-':'+').(int)$content['ctime'], 'ctime' => ($content['ctime']<0?'-':'+').(int)$content['ctime'],
)), function($path) use (&$deleted, &$errors) )), function($path) use (&$deleted, &$errors)
{ {
if (Vfs::unlink($path)) if (Vfs::is_dir($path))
{
Vfs::rmdir($path);
}
elseif (Vfs::unlink($path))
{ {
++$deleted; ++$deleted;
} }