#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 <span data-processor="relativetime" data-value="2026-10-30T09:11:16+00:00" > 10/30/26, 09:11 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 97233 <span data-processor="relativetime" data-value="2026-10-30T10:15:55+00:00" > 10/30/26, 10:15 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 97233 <span data-processor="relativetime" data-value="2026-10-30T10:16:43+00:00" > 10/30/26, 10:16 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-30T10:20:15+00:00" > 10/30/26, 10:20 </span> -
Gerrit Code Review pushed patch set 3 for 14.3 to change 97233 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2026-10-30T10:39:47+00:00" > 10/30/26, 10:39 </span> -
Benni Mack commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2026-10-30T10:55:15+00:00" > 10/30/26, 10:55 </span>Applied in changeset commit:ae3fa280a4a29e4b39259d840a525bcefccc4297.
Applied in changeset commit:aaf19c3f420416e250e500e13ed080b4e9ec5051.