Skip to content
Snippets Groups Projects
Commit 497f313e authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[BUGFIX] Avoid trim(null) in ContentObjectRenderer->stdWrap_*()

Calling trim() with something else than a string
emits a E_DEPRECATED error with PHP 8.1.
Some ContentObjectRenderer->stdWrap_*() are affected
by this and sanitized with explicit string casts.

This is a bit of an artificial thing that mostly
only happens in tests since in TypoScript usually
everything is a string anyways. However, depending
on how stdWrap_* methods are fed and used code-wise, it
could also be a db return, which might be int or null.
We thus can't simply change the method signature to
'string $content' and need to go with casts instead.

Resolves: #95774
Releases: master
Change-Id: Ifbb90170c4561e1570444c0c3d818aa32e58c827
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71972


Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 41af981c
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