From c31f001f22556a58028e514af5a031027ed72c96 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 4 Apr 2012 11:08:14 -0500 Subject: [PATCH] fix url https bug. --- laravel/url.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/laravel/url.php b/laravel/url.php index 1b635873..cf23dc47 100644 --- a/laravel/url.php +++ b/laravel/url.php @@ -63,7 +63,7 @@ public static function base() // If the application's URL configuration is set, we will just use that // instead of trying to guess the URL from the $_SERVER array's host - // and script variables as this is more reliable. + // and script variables as this is a more reliable method. if (($url = Config::get('application.url')) !== '') { $base = $url; @@ -112,6 +112,10 @@ public static function to($url = '', $https = false) { $root = preg_replace('~http://~', 'https://', $root, 1); } + else + { + $root = preg_replace('~https://~', 'http://', $root, 1); + } return rtrim($root, '/').'/'.ltrim($url, '/'); }