fix(LocalPreviewStorage): Use correct regex to detect files in nested directory format

Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
This commit is contained in:
David Dreschner 2026-04-28 13:02:10 +02:00
parent 1047d52f52
commit fce8b710df
No known key found for this signature in database

View file

@ -281,7 +281,7 @@ class LocalPreviewStorage implements IPreviewStorage {
// Move old flat preview to new nested directory format.
$dirName = str_replace($this->getPreviewRootFolder(), '', $item['filePath']);
if (preg_match('/[0-9a-e]\/[0-9a-e]\/[0-9a-e]\/[0-9a-e]\/[0-9a-e]\/[0-9a-e]\/[0-9a-e]\/[0-9]+/', $dirName) !== 1) {
if (preg_match('/([[:xdigit:]]\/){7}[0-9]+/', $dirName) !== 1) {
$previewPath = $this->constructPath($preview);
$this->createParentFiles($previewPath);
$ok = rename($item['realPath'], $previewPath);