Commit d77b3a45 authored by Georg Ringer's avatar Georg Ringer Committed by Benni Mack
Browse files

[BUGFIX] Change 3rd argument of calls to callUserFunction()

The third argument of `GeneralUtility::callUserFunction` must be either
an object or null.
Ensure the argument is always null instead of false to avoid
triggering a deprecation log entry.

Resolves: #91184
Releases: master
Change-Id: I5ee0a58d812de737bd631e5c1986895e69c158af
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64415


Tested-by: default avatarJosef Glatz <josefglatz@gmail.com>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarJosef Glatz <josefglatz@gmail.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent a7e89583
......@@ -134,7 +134,7 @@ class LinkService implements SingletonInterface
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Link']['resolveByStringRepresentation'] ?? null)) {
$params = ['urn' => $urn, 'result' => &$result];
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Link']['resolveByStringRepresentation'] as $hookMethod) {
$fakeThis = false;
$fakeThis = null;
GeneralUtility::callUserFunction($hookMethod, $params, $fakeThis);
}
}
......
......@@ -610,7 +610,7 @@ class TypoScriptParser
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsparser.php']['preParseFunc'][$modifierName])) {
$hookMethod = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsparser.php']['preParseFunc'][$modifierName];
$params = ['currentValue' => $currentValue, 'functionArgument' => $modifierArgument];
$fakeThis = false;
$fakeThis = null;
$newValue = GeneralUtility::callUserFunction($hookMethod, $params, $fakeThis);
} else {
self::getLogger()->warning('Missing function definition for ' . $modifierName . ' on TypoScript');
......
......@@ -1691,7 +1691,7 @@ class GeneralUtility
*/
public static function minifyJavaScript($script, &$error = '')
{
$fakeThis = false;
$fakeThis = null;
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript'] ?? [] as $hookMethod) {
try {
$parameters = ['script' => $script];
......@@ -3126,7 +3126,7 @@ class GeneralUtility
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Utility\GeneralUtility::class]['moveUploadedFile'] ?? null)) {
$params = ['source' => $source, 'destination' => $destination, 'method' => 'upload_copy_move'];
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Utility\GeneralUtility::class]['moveUploadedFile'] as $hookMethod) {
$fakeThis = false;
$fakeThis = null;
self::callUserFunction($hookMethod, $params, $fakeThis);
}
}
......@@ -3163,7 +3163,7 @@ class GeneralUtility
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Utility\GeneralUtility::class]['moveUploadedFile'] ?? null)) {
$params = ['source' => $uploadedFileName, 'destination' => $tempFile, 'method' => 'upload_to_tempfile'];
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Utility\GeneralUtility::class]['moveUploadedFile'] as $hookMethod) {
$fakeThis = false;
$fakeThis = null;
self::callUserFunction($hookMethod, $params, $fakeThis);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment