From d2167a01ec5bd134a4138b50d76487caa72245c6 Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Tue, 14 Sep 2010 15:05:42 -0400 Subject: Fixed a bug in the URL Helper where prep_url() could cause a PHP error on PHP versions < 5.1.2. --- system/helpers/url_helper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system/helpers') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 7707d6854..dad761145 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -446,7 +446,9 @@ if ( ! function_exists('prep_url')) return ''; } - if ( ! parse_url($str, PHP_URL_SCHEME)) + $url = parse_url($str); + + if ( ! $url OR ! isset($url['scheme'])) { $str = 'http://'.$str; } -- cgit v1.2.3-24-g4f1b