Skip to content

Commit

Permalink
fix(output): improved handling of output/url
Browse files Browse the repository at this point in the history
  • Loading branch information
jeabakker committed Jan 15, 2025
1 parent a84b70a commit 379c021
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions views/default/output/url.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}

if (!$url && isset($vars['value'])) {
$url = trim($vars['value']);
$url = trim((string) $vars['value']);
unset($vars['value']);
}

Expand All @@ -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']);
Expand Down Expand Up @@ -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, '<')) {
Expand All @@ -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, '<')) {
Expand All @@ -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);
}

Expand Down

0 comments on commit 379c021

Please sign in to comment.