Issue #3241300 by alexpott: template_preprocess_responsive_image_formatter() causes deprecations on PHP 8.1
parent
93e9e36c51
commit
469425a4aa
|
@ -106,7 +106,7 @@ function template_preprocess_responsive_image_formatter(&$variables) {
|
|||
$item = $variables['item'];
|
||||
$attributes = [];
|
||||
// Do not output an empty 'title' attribute.
|
||||
if (mb_strlen($item->title) != 0) {
|
||||
if (!is_null($item->title) && mb_strlen($item->title) != 0) {
|
||||
$attributes['title'] = $item->title;
|
||||
}
|
||||
$attributes['alt'] = $item->alt;
|
||||
|
|
Loading…
Reference in New Issue