Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • typo3 typo3
  • Project information
    • Project information
    • Activity
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Insights
    • Repository
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • typo3typo3
  • typo3typo3
  • Repository
Switch branch/tag
  • typo3
  • typo3
  • sysext
  • frontend
  • Classes
  • ContentObject
  • ContentObjectRenderer.php
Find file BlameHistoryPermalink
  • Christian Kuhn's avatar
    [BUGFIX] Avoid trim(null) in ContentObjectRenderer->stdWrap_*() · 497f313e
    Christian Kuhn authored Oct 25, 2021
    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: Benni Mack's avatarBenni Mack <benni@typo3.org>
    Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
    Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
    Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
    Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
    Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
    Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
    497f313e