Navigation Menu

Skip to content

Commit

Permalink
[TASK] Use null coalescing operator for userfunction's configuration
Browse files Browse the repository at this point in the history
Call the user functions with an empty array instead of null as 2nd
argument.

Resolves: #93513
Releases: master, 10.4
Change-Id: Ibc50b9e3ec7defc0100e5ae6447b05fca8e77cd7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68127
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
  • Loading branch information
georgringer committed Mar 2, 2021
1 parent a16dd22 commit 473601a
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -1898,7 +1898,7 @@ public function stdWrap_numRows($content = '', $conf = [])
*/
public function stdWrap_preUserFunc($content = '', $conf = [])
{
return $this->callUserFunction($conf['preUserFunc'], $conf['preUserFunc.'], $content);
return $this->callUserFunction($conf['preUserFunc'], $conf['preUserFunc.'] ?? [], $content);
}

/**
Expand Down Expand Up @@ -2839,7 +2839,7 @@ public function stdWrap_insertData($content = '')
*/
public function stdWrap_postUserFunc($content = '', $conf = [])
{
return $this->callUserFunction($conf['postUserFunc'], $conf['postUserFunc.'], $content);
return $this->callUserFunction($conf['postUserFunc'], $conf['postUserFunc.'] ?? [], $content);
}

/**
Expand Down Expand Up @@ -3901,7 +3901,7 @@ public function _parseFunc($theValue, $conf)
}
// userFunc
if ($conf['userFunc'] ?? false) {
$data = $this->callUserFunction($conf['userFunc'], $conf['userFunc.'], $data);
$data = $this->callUserFunction($conf['userFunc'], $conf['userFunc.'] ?? [], $data);
}
// Makelinks: (Before search-words as we need the links to be generated when searchwords go on...!)
if ($conf['makelinks'] ?? false) {
Expand Down Expand Up @@ -4063,7 +4063,7 @@ public function _parseFunc($theValue, $conf)
}
// userFunc
if (!empty($conf['nonTypoTagUserFunc'])) {
$contentAccum[$a] = $this->callUserFunction($conf['nonTypoTagUserFunc'], $conf['nonTypoTagUserFunc.'], (string)($contentAccum[$a] ?? ''));
$contentAccum[$a] = $this->callUserFunction($conf['nonTypoTagUserFunc'], $conf['nonTypoTagUserFunc.'] ?? [], (string)($contentAccum[$a] ?? ''));
}
}
}
Expand Down Expand Up @@ -5198,7 +5198,7 @@ public function typoLink($linkText, $conf)
// Call user function:
if ($conf['userFunc'] ?? false) {
$finalTagParts['TAG'] = $finalAnchorTag;
$finalAnchorTag = $this->callUserFunction($conf['userFunc'], $conf['userFunc.'], $finalTagParts);
$finalAnchorTag = $this->callUserFunction($conf['userFunc'], $conf['userFunc.'] ?? [], $finalTagParts);
}

// Hook: Call post processing function for link rendering:
Expand Down

0 comments on commit 473601a

Please sign in to comment.