From b081288188bb1744c9d7bd075aa5936e0ccbb9c4 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 14 Nov 2014 22:44:25 -0500 Subject: Use Pimple instead of Core\Registry and add Monolog for logging --- app/Core/Request.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/Core/Request.php') diff --git a/app/Core/Request.php b/app/Core/Request.php index 1b643208..c7ca3184 100644 --- a/app/Core/Request.php +++ b/app/Core/Request.php @@ -124,6 +124,20 @@ class Request return $this->getHeader('X-Requested-With') === 'XMLHttpRequest'; } + /** + * Check if the page is requested through HTTPS + * + * Note: IIS return the value 'off' and other web servers an empty value when it's not HTTPS + * + * @static + * @access public + * @return boolean + */ + public static function isHTTPS() + { + return isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== '' && $_SERVER['HTTPS'] !== 'off'; + } + /** * Return a HTTP header value * -- cgit v1.2.3