Skip to content

Commit

Permalink
[BUGFIX] Change 3rd argument of calls to callUserFunction()
Browse files Browse the repository at this point in the history
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: Josef Glatz <josefglatz@gmail.com>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Josef Glatz <josefglatz@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
georgringer authored and bmack committed May 6, 2020
1 parent a7e8958 commit d77b3a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion typo3/sysext/core/Classes/LinkHandling/LinkService.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function resolveByStringRepresentation(string $urn): array
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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ protected function executeValueModifier($modifierName, $modifierArgument = null,
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');
Expand Down
6 changes: 3 additions & 3 deletions typo3/sysext/core/Classes/Utility/GeneralUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ public static function xmlRecompileFromStructValArray(array $vals)
*/
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];
Expand Down Expand Up @@ -3126,7 +3126,7 @@ public static function upload_copy_move($source, $destination)
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);
}
}
Expand Down Expand Up @@ -3163,7 +3163,7 @@ public static function upload_to_tempfile($uploadedFileName)
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);
}
}
Expand Down

0 comments on commit d77b3a4

Please sign in to comment.