Merge pull request #595 from nextcloud/bugfix/591/fix-strict-version-path-trimming
fix(versions): Fix strict trimming of version paths
This commit is contained in:
Коммит
9eb3ba0979
|
@ -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
|
||||
|
|
|
@ -134,7 +134,10 @@ class Operation implements IComplexOperation, ISpecificOperation {
|
|||
[$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);
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
<MissingDependency>
|
||||
<code><![CDATA[StorageWrapper]]></code>
|
||||
</MissingDependency>
|
||||
<PossiblyFalseArgument>
|
||||
<code><![CDATA[strrpos($innerPath, '.v')]]></code>
|
||||
</PossiblyFalseArgument>
|
||||
<PossiblyUndefinedArrayOffset>
|
||||
<code><![CDATA[$innerPath]]></code>
|
||||
</PossiblyUndefinedArrayOffset>
|
||||
|
|
Загрузка…
Ссылка в новой задаче