Skip to content

Commit

Permalink
Remove notice with empty description
Browse files Browse the repository at this point in the history
This `trim` isn't really needed here, but PHP 8+ shows a message like ```Deprecated: trim(): Passing null to parameter Octopoos#1  of type string is deprecated``` when field description is empty.
  • Loading branch information
Ilya-Zhulin authored Dec 2, 2023
1 parent a994e6d commit 5c0c5f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/cck/_/plugin/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ public static function g_onCCK_FieldPrepareForm( &$field, &$config = array() )
if ( trim( $field->label ) ) {
$field->label = JText::_( 'COM_CCK_' . str_replace( ' ', '_', trim( $field->label ) ) );
}
if ( trim( $field->description ) ) {
if ( $field->description) {
$desc = trim( strip_tags( $field->description ) );
if ( $desc ) {
$field->description = JText::_( 'COM_CCK_' . str_replace( ' ', '_', $desc ) );
Expand Down Expand Up @@ -1336,4 +1336,4 @@ public static function g_isStaticVariation( &$field, $variation, $strict = false
}
}
}
?>
?>

0 comments on commit 5c0c5f5

Please sign in to comment.