From b314a9a072d301e2e89c4873d76429ba46e9c94a Mon Sep 17 00:00:00 2001 From: ewinslow Date: Tue, 2 Nov 2010 20:16:13 +0000 Subject: Refs #2463: Added url normalization support to output/url, output/confirmlink. Enhanced normalization to take care of urls like "example.com" git-svn-id: http://code.elgg.org/elgg/trunk@7199 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/output/confirmlink.php | 2 +- views/default/output/url.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'views/default/output') diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index d7bb5c56f..4d1bc0ab9 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -18,7 +18,7 @@ if (!$confirm) { } // always generate missing action tokens -$link = elgg_add_action_tokens_to_url($vars['href']); +$link = elgg_add_action_tokens_to_url(elgg_normalize_url($vars['href'])); if (isset($vars['class']) && $vars['class']) { $class = 'class="' . $vars['class'] . '"'; diff --git a/views/default/output/url.php b/views/default/output/url.php index 9dd0bf3f5..2a01e32d0 100644 --- a/views/default/output/url.php +++ b/views/default/output/url.php @@ -51,9 +51,7 @@ if (!empty($url)) { $text = htmlentities($url, ENT_QUOTES, 'UTF-8'); } - if ((substr_count($url, "http://") == 0) && (substr_count($url, "https://") == 0)) { - $url = "http://" . $url; - } + $url = elgg_normalize_url($url); if (isset($vars['is_action'])) { $url = elgg_add_action_tokens_to_url($url); -- cgit v1.2.3