Skip to content

Commit

Permalink
[BUGFIX] Cast to string before trim (#1934)
Browse files Browse the repository at this point in the history
Fixes PHP Runtime Deprecation Notice: trim(): Passing null to parameter #1 ($string) of type string is deprecated in Classes/ViewHelpers/Format/TrimViewHelper.php line 45
  • Loading branch information
chrisi51 authored Feb 26, 2025
1 parent d2ced75 commit 4b779e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/ViewHelpers/Format/TrimViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public static function renderStatic(
$characters = $arguments['characters'];
$content = $renderChildrenClosure();
if (!empty($characters)) {
$content = trim($content, $characters);
$content = trim((string) $content, $characters);
} else {
$content = trim($content);
$content = trim((string) $content);
}
return $content;
}
Expand Down

0 comments on commit 4b779e0

Please sign in to comment.