From 43966c2edb15d673556e9705c05921a361d856d1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 12 Sep 2024 16:13:43 +0200 Subject: [PATCH 1/4] fix(versions): Fix strict trimming of version paths Signed-off-by: Joas Schilling --- lib/Operation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Operation.php b/lib/Operation.php index afb6d0d..b8ab90a 100644 --- a/lib/Operation.php +++ b/lib/Operation.php @@ -134,7 +134,10 @@ protected function translatePath(IStorage $storage, string $path): string { [$folder, $innerPath] = explode('/', $path, 2); if ($folder === 'files_versions') { - $innerPath = substr($innerPath, 0, strrpos($innerPath, '.v')); + if (preg_match('/.+\.v\d{10}$/', basename($innerPath))) { + // Remove trailing ".v{timestamp}" + $innerPath = substr($innerPath, 0, -12); + } return 'files/' . $innerPath; } elseif ($folder === 'thumbnails') { [$fileId,] = explode('/', $innerPath, 2); From 529a294f946a95e445e4aafe7c4152d724b4d37e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 12 Sep 2024 16:18:43 +0200 Subject: [PATCH 2/4] chore(release): Add changelog for 1.20.1 Signed-off-by: Joas Schilling --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bfeae8..045f434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ # Changelog All notable changes to this project will be documented in this file. +## 1.20.1 – 2024-09-12 +### Fixed +- fix(versions): Fix compatibility with files_versions and PHP strict types + ## 1.20.0 – 2024-07-30 ### Changed - Require Nextcloud 30 From 0cf884c12148ca2546412e48f3d218c200eec6be Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 12 Sep 2024 16:19:55 +0200 Subject: [PATCH 3/4] chore(release): Bump version to 1.20.1 Signed-off-by: Joas Schilling --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 8ec578f..de45bf2 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -17,7 +17,7 @@ An example would be to deny access to MS Excel/XLSX files owned by the "Human Re Learn more about File Access Control on [https://nextcloud.com/workflow](https://nextcloud.com/workflow) - 1.20.0 + 1.20.1 agpl Arthur Schiwon Joas Schilling From ffc3d2ffdcb12e283c621cb79f55c1f465163aa6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 12 Sep 2024 16:24:27 +0200 Subject: [PATCH 4/4] ci: Update psalm baseline indicating it Signed-off-by: Joas Schilling --- tests/psalm-baseline.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index b6b2f69..b17e249 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -18,9 +18,6 @@ - - -