tags. * @uses string $vars['href'] The unencoded url string * @uses bool $vars['encode_text'] Run $vars['text'] through htmlspecialchars()? * @uses bool $vars['is_action'] Is this a link to an action? * */ $url = elgg_get_array_value('href', $vars, null); if (!$url and isset($vars['value'])) { $url = trim($vars['value']); unset($vars['value']); } if (isset($vars['text'])) { if (isset($vars['encode_text']) && $vars['encode_text']) { $text = htmlspecialchars($vars['text'], ENT_QUOTES, 'UTF-8', false); } else { $text = $vars['text']; } unset($vars['text']); } else { $text = htmlspecialchars($url, ENT_QUOTES, 'UTF-8', false); } unset($vars['encode_text']); if ($url) { $url = elgg_normalize_url($url); if (isset($vars['is_action'])) { $url = elgg_add_action_tokens_to_url($url, false); unset($vars['is_action']); } $vars['href'] = $url; } $attributes = elgg_format_attributes($vars); echo "$text";