// Add getShopProtocol to have the current protocol use by the current shop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10984 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -132,6 +132,20 @@ class ToolsCore
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getShopProtocol return the available protocol for the current shop in use
|
||||||
|
* SSL if Configuration is set on and available for the server
|
||||||
|
* @static
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public static function getShopProtocol()
|
||||||
|
{
|
||||||
|
$id_shop = Context::getContext()->shop()->id;
|
||||||
|
$protocol = (Configuration::get('PS_SSL_ENABLED', null, null, $id_shop) || (!empty($_SERVER['HTTPS'])
|
||||||
|
&& strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';
|
||||||
|
return $protocol;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getProtocol return the set protocol according to configuration (http[s])
|
* getProtocol return the set protocol according to configuration (http[s])
|
||||||
* @param Boolean true if require ssl
|
* @param Boolean true if require ssl
|
||||||
|
|||||||
Reference in New Issue
Block a user