1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-02 19:27:52 +02:00

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.
This commit is contained in:
All Unser Miranda
2012-10-22 23:53:48 -02:00
parent 4a92b95ffb
commit d1897038a9

View File

@@ -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']), '\\/');
}
}