Commit 1324f835 authored by Robert Kärner's avatar Robert Kärner Committed by Georg Ringer
Browse files

[BUGFIX] Fix uninitialized string offset when renaming folder

On PHP 8.0, renaming a folder in the backend might fail
with a "PHP Warning: Uninitialized string offset 0". This
is fixed by utilizing the substr() function instead.

Resolves: #95273
Releases: master
Change-Id: Ib642a25492c933b6fae857206c4535b7a861cc3c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71123

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 0d6766d4
......@@ -397,7 +397,7 @@ class StorageRepository implements LoggerAwareInterface
}
// normalize path information (`//`, `../`)
$localPath = PathUtility::getCanonicalPath($localPath);
if ($localPath[0] !== '/') {
if (!str_starts_with($localPath, '/')) {
$localPath = '/' . $localPath;
}
$bestMatchStorageUid = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment