diff options
Diffstat (limited to 'views/default/output')
-rw-r--r-- | views/default/output/url.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/views/default/output/url.php b/views/default/output/url.php index 87d3a68a1..19ad331e1 100644 --- a/views/default/output/url.php +++ b/views/default/output/url.php @@ -10,7 +10,8 @@ * * @uses string $vars['href'] The string to display in the <a></a> tags * @uses string $vars['text'] The string between the <a></a> tags. - * @uses bool $vars['target'] Set the target="" attribute. + * @uses string $vars['target'] Set the target="" attribute. + * @uses bool $vars['encode_text'] Run $vars['text'] through htmlentities()? * @uses string $vars['class'] what to add in class="" * @uses string $vars['js'] Javascript to insert in <a> tag * @uses bool $vars['is_action'] Is this a link to an action? @@ -39,13 +40,17 @@ if (!empty($url)) { } if (array_key_exists('text', $vars) && $vars['text']) { - $text = htmlentities($vars['text'], ENT_QUOTES, 'UTF-8'); + if (isset($vars['encode_text']) && $vars['encode_text']) { + $text = htmlentities($vars['text'], ENT_QUOTES, 'UTF-8'); + } else { + $text = $vars['text']; + } } else { $text = htmlentities($url, ENT_QUOTES, 'UTF-8'); } - if ((substr_count($url, "http://") == 0) && (substr_count($url, "https://") == 0)) { - $url = "http://" . $url; + if ((substr_count($url, "http://") == 0) && (substr_count($url, "https://") == 0)) { + $url = "http://" . $url; } if (array_key_exists('is_action', $vars) && $vars['is_action']) { |