From d1897038a931b95c46ee4e56afc60f9f7d4328e8 Mon Sep 17 00:00:00 2001 From: All Unser Miranda Date: Mon, 22 Oct 2012 23:53:48 -0200 Subject: [PATCH] Updated the method to get the server protocol This is the same commit as before, but in this one i've fixed an idiot error on the 'if' statement. --- monstra/helpers/url.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monstra/helpers/url.php b/monstra/helpers/url.php index c25faea..8e3581b 100644 --- a/monstra/helpers/url.php +++ b/monstra/helpers/url.php @@ -93,7 +93,7 @@ * @return string */ public static function find($url) { - $https = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == strtolower('on')) ? 'https://' : 'http://'; + $https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://'; $pos = strpos($url, $https); if ($pos === false) { $url_output = Option::get('siteurl') . $url; } else { $url_output = $url; } return $url_output; @@ -110,7 +110,7 @@ * @return string */ public static function base() { - $https = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == strtolower('on')) ? 'https://' : 'http://'; + $https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://'; return $https . rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/'); } } \ No newline at end of file