#111286PlainTextExtractor may delete the original file of a local storage
Description
TYPO3\CMS\Core\Resource\TextExtraction\PlainTextExtractor::extractText() reads the file through $file->getForLocalProcessing(false) and removes the returned path afterwards if its base name differs from $file->getName(), assuming it is a temporary copy of a remote file:
if (PathUtility::basename($localTempFile) !== $file->getName()) {
unlink($localTempFile);
}
For a local storage, getForLocalProcessing(false) returns the path of the original file, not a copy. Whenever the name stored in sys_file
differs from the actual file name in the storage, e.g. because of an outdated index record or a different Unicode normalization of the
name, the original file is deleted from the storage when its text is extracted.
The extractor does not need a local file at all. Reading the contents with $file->getContents() works for local and remote storages and
leaves no temporary file behind.
Reviews 2
History 26
-
Gerrit Code Review pushed patch set 1 for main to change 97227 status
NewUnder Review 10/30/26, 09:11 -
Gerrit Code Review pushed patch set 1 for 14.3 to change 97233 10/30/26, 10:15
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 97233 10/30/26, 10:16
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % 10/30/26, 10:20 -
Gerrit Code Review pushed patch set 3 for 14.3 to change 97233 status
ResolvedUnder Review 10/30/26, 10:39 -
Benni Mack commented and changed status
Under ReviewResolved 10/30/26, 10:55Applied in changeset commit:ae3fa280a4a29e4b39259d840a525bcefccc4297.
Applied in changeset commit:aaf19c3f420416e250e500e13ed080b4e9ec5051.