From e92934e6126caf3f742d16c6666d36e19443c0a3 Mon Sep 17 00:00:00 2001 From: ginus Date: Mon, 6 Jan 2014 16:28:34 +0800 Subject: [PATCH] fix when $_SERVER['HTTPS'] is "ON" when $_SERVER['HTTPS'] is "ON" it doesn't work well --- framework/yii/web/Request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/yii/web/Request.php b/framework/yii/web/Request.php index 689027f..8a980d5 100644 --- a/framework/yii/web/Request.php +++ b/framework/yii/web/Request.php @@ -668,8 +668,8 @@ class Request extends \yii\base\Request */ public function getIsSecureConnection() { - return isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] == 1) - || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'; + return isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'],'on') || $_SERVER['HTTPS'] == 1) + || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'],'https'); } /**