Issue Bug Resolved

#111286PlainTextExtractor may delete the original file of a local storage

Benni Mack 10/30/26, 08:28 updated 10/30/26, 10:55

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

  1. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-30T10:20:15+00:00" > 10/30/26, 10:20 </span>

    Applied in changeset commit:aaf19c3f420416e250e500e13ed080b4e9ec5051.

  2. Gerrit Code Review pushed patch set 3 for 14.3 to change 97233 status Resolved Under Review <span data-processor="relativetime" data-value="2026-10-30T10:39:47+00:00" > 10/30/26, 10:39 </span>

  3. Benni Mack commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-10-30T10:55:15+00:00" > 10/30/26, 10:55 </span>

    Applied in changeset commit:ae3fa280a4a29e4b39259d840a525bcefccc4297.