Issue Bug Resolved

#111138Copying a folder into its own subfolder nests endlessly

Wolfgang Klinger 10/19/26, 06:11 updated 10/23/26, 08:00

Description

ResourceStorage::copyFolder() no longer checks if the target folder is inside the folder to copy. Copying /foo/ into /foo/sub/ creates /foo/sub/foo/sub/foo/... until the path gets too long. No exception is thrown.

Steps to reproduce

$storage->copyFolder(
    $resourceFactory->getFolderObjectFromCombinedIdentifier('1:/foo/'),
    $resourceFactory->getFolderObjectFromCombinedIdentifier('1:/foo/sub/')
);

*Expected*
An InvalidTargetFolderException, like moveFolder() throws.

*Cause*
#51670 added an isWithinFolder() check with exception code 1422723059. #92806 (TYPO3 v11.2) replaced it with the name conflict check and reused the same code, so the guard is gone.

The filelist hides “Paste into” in this case, so the backend UI is not affected. API calls, CLI commands and extensions are.

Reviews 2

History 25

  1. Wolfgang Klinger commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-23T08:00:16+00:00" > 10/23/26, 08:00 </span>

    Applied in changeset commit:0f30455f5ef5e13972d6b693b7d9be15f523d6f8.