From f3193c88779111516fb21923a7991eb765e4a127 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 29 Dec 2010 13:22:30 +0000 Subject: supporting anchors with a href in output/url git-svn-id: http://code.elgg.org/elgg/trunk@7735 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/output/url.php | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/views/default/output/url.php b/views/default/output/url.php index 8ea84d3d6..4f34c120e 100644 --- a/views/default/output/url.php +++ b/views/default/output/url.php @@ -13,27 +13,26 @@ * */ -$url = trim($vars['href']); +$url = elgg_get_array_value('href', $vars, null); if (!$url and isset($vars['value'])) { $url = trim($vars['value']); unset($vars['value']); } -if (!empty($url)) { - if (isset($vars['text'])) { - if (isset($vars['encode_text']) && $vars['encode_text']) { - $text = htmlspecialchars($vars['text'], ENT_QUOTES, 'UTF-8'); - } else { - $text = $vars['text']; - } - - unset($vars['text']); +if (isset($vars['text'])) { + if (isset($vars['encode_text']) && $vars['encode_text']) { + $text = htmlspecialchars($vars['text'], ENT_QUOTES, 'UTF-8'); } else { - $text = htmlspecialchars($url, ENT_QUOTES, 'UTF-8'); + $text = $vars['text']; } + unset($vars['text']); +} else { + $text = htmlspecialchars($url, ENT_QUOTES, 'UTF-8'); +} - unset($vars['encode_text']); +unset($vars['encode_text']); +if ($url) { $url = elgg_normalize_url($url); if (isset($vars['is_action'])) { @@ -42,7 +41,7 @@ if (!empty($url)) { } $vars['href'] = $url; +} - $attributes = elgg_format_attributes($vars); - echo "$text"; -} \ No newline at end of file +$attributes = elgg_format_attributes($vars); +echo "$text"; \ No newline at end of file -- cgit v1.2.3