From 726c8eb63eac6f64408536dd39b7854dfa000251 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 12 Mar 2010 11:55:51 +0000 Subject: prep_url() will now not append http:// to string if a protocol is already used. That would really mess up itunes://, spotify://, telnet://, etc. --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 90ea9207e..86caa278c 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -446,7 +446,7 @@ if ( ! function_exists('prep_url')) return ''; } - if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') + if (!preg_match('/^[a-z]{3,6}:\/\//', $str)) { $str = 'http://'.$str; } -- cgit v1.2.3-24-g4f1b