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
|
# Changelog
|
||||||
All notable changes to this project will be documented in this file.
|
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
|
## 1.20.0 – 2024-07-30
|
||||||
### Changed
|
### Changed
|
||||||
- Require Nextcloud 30
|
- Require Nextcloud 30
|
||||||
|
|
|
@ -134,7 +134,10 @@ class Operation implements IComplexOperation, ISpecificOperation {
|
||||||
[$folder, $innerPath] = explode('/', $path, 2);
|
[$folder, $innerPath] = explode('/', $path, 2);
|
||||||
|
|
||||||
if ($folder === 'files_versions') {
|
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;
|
return 'files/' . $innerPath;
|
||||||
} elseif ($folder === 'thumbnails') {
|
} elseif ($folder === 'thumbnails') {
|
||||||
[$fileId,] = explode('/', $innerPath, 2);
|
[$fileId,] = explode('/', $innerPath, 2);
|
||||||
|
|
|
@ -18,9 +18,6 @@
|
||||||
<MissingDependency>
|
<MissingDependency>
|
||||||
<code><![CDATA[StorageWrapper]]></code>
|
<code><![CDATA[StorageWrapper]]></code>
|
||||||
</MissingDependency>
|
</MissingDependency>
|
||||||
<PossiblyFalseArgument>
|
|
||||||
<code><![CDATA[strrpos($innerPath, '.v')]]></code>
|
|
||||||
</PossiblyFalseArgument>
|
|
||||||
<PossiblyUndefinedArrayOffset>
|
<PossiblyUndefinedArrayOffset>
|
||||||
<code><![CDATA[$innerPath]]></code>
|
<code><![CDATA[$innerPath]]></code>
|
||||||
</PossiblyUndefinedArrayOffset>
|
</PossiblyUndefinedArrayOffset>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче