diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-29 13:22:30 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-29 13:22:30 +0000 |
commit | f3193c88779111516fb21923a7991eb765e4a127 (patch) | |
tree | 4396a3d32942bd162a74a7ad20e95bbb65b70268 | |
parent | dd687a5594994f41df26a781b878213271aad181 (diff) | |
download | elgg-f3193c88779111516fb21923a7991eb765e4a127.tar.gz elgg-f3193c88779111516fb21923a7991eb765e4a127.tar.bz2 |
supporting anchors with a href in output/url
git-svn-id: http://code.elgg.org/elgg/trunk@7735 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | views/default/output/url.php | 29 |
1 files 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 "<a $attributes>$text</a>"; -}
\ No newline at end of file +$attributes = elgg_format_attributes($vars); +echo "<a $attributes>$text</a>";
\ No newline at end of file |