diff options
-rw-r--r-- | apps/files_trashbin/lib/Helper.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/files_trashbin/lib/Helper.php b/apps/files_trashbin/lib/Helper.php index 9c312443164..a309d533e54 100644 --- a/apps/files_trashbin/lib/Helper.php +++ b/apps/files_trashbin/lib/Helper.php @@ -72,8 +72,9 @@ class Helper { $timestamp = substr(pathinfo($parts[0], PATHINFO_EXTENSION), 1); } $originalPath = ''; - if (isset($originalLocations[$id][$timestamp])) { - $originalPath = $originalLocations[$id][$timestamp]; + $originalName = substr($entryName, 0, -strlen($timestamp)-2); + if (isset($originalLocations[$originalName][$timestamp])) { + $originalPath = $originalLocations[$originalName][$timestamp]; if (substr($originalPath, -1) === '/') { $originalPath = substr($originalPath, 0, -1); } @@ -90,7 +91,11 @@ class Helper { 'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE ); if ($originalPath) { - $i['extraData'] = $originalPath . '/' . $id; + if ($originalPath !== '.') { + $i['extraData'] = $originalPath . '/' . $originalName; + } else { + $i['extraData'] = $originalName; + } } $result[] = new FileInfo($absoluteDir . '/' . $i['name'], $storage, $internalPath . '/' . $i['name'], $i, $mount); } |