diff --git a/views/default/output/url.php b/views/default/output/url.php index 33f577f085..735842ffd4 100644 --- a/views/default/output/url.php +++ b/views/default/output/url.php @@ -52,7 +52,7 @@ } if (!$url && isset($vars['value'])) { - $url = trim($vars['value']); + $url = trim((string) $vars['value']); unset($vars['value']); } @@ -64,7 +64,7 @@ if (elgg_extract('encode_text', $vars, false)) { $text = htmlspecialchars((string) $vars['text'], ENT_QUOTES, 'UTF-8', false); } else { - $text = elgg_extract('text', $vars); + $text = (string) elgg_extract('text', $vars); } unset($vars['text']); @@ -127,7 +127,7 @@ ], $text); } -$icon = elgg_extract('icon', $vars, ''); +$icon = (string) elgg_extract('icon', $vars); unset($vars['icon']); if ($icon && !str_starts_with($icon, '<')) { @@ -136,7 +136,7 @@ ]); } -$icon_alt = elgg_extract('icon_alt', $vars, ''); +$icon_alt = (string) elgg_extract('icon_alt', $vars); unset($vars['icon_alt']); if ($icon_alt && !str_starts_with($icon_alt, '<')) { @@ -145,10 +145,10 @@ ]); } -$badge = elgg_extract('badge', $vars); +$badge = (string) elgg_extract('badge', $vars); unset($vars['badge']); -if (!is_null($badge)) { +if (!elgg_is_empty($badge)) { $badge = elgg_format_element('span', ['class' => 'elgg-badge'], $badge); }