diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php index 6c81c57db9138fac9cbca0608c48faeb2944a9a1..2a9adf879ba9b0997e7f3d9937e95483b2ae0654 100644 --- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php +++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php @@ -3228,6 +3228,14 @@ class GeneralUtility */ public static function upload_copy_move($source, $destination) { + if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Core\Utility\GeneralUtility']['moveUploadedFile'] ?? null)) { + $params = ['source' => $source, 'destination' => $destination, 'method' => 'upload_copy_move']; + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Core\Utility\GeneralUtility']['moveUploadedFile'] as $hookMethod) { + $fakeThis = false; + self::callUserFunction($hookMethod, $params, $fakeThis); + } + } + $result = false; if (is_uploaded_file($source)) { // Return the value of move_uploaded_file, and if FALSE the temporary $source is still @@ -3256,6 +3264,14 @@ class GeneralUtility { if (is_uploaded_file($uploadedFileName)) { $tempFile = self::tempnam('upload_temp_'); + if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Core\Utility\GeneralUtility']['moveUploadedFile'] ?? null)) { + $params = ['source' => $uploadedFileName, 'destination' => $tempFile, 'method' => 'upload_to_tempfile']; + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Core\Utility\GeneralUtility']['moveUploadedFile'] as $hookMethod) { + $fakeThis = false; + self::callUserFunction($hookMethod, $params, $fakeThis); + } + } + move_uploaded_file($uploadedFileName, $tempFile); return @is_file($tempFile) ? $tempFile : ''; }