diff --git a/framework/yii/db/Connection.php b/framework/yii/db/Connection.php index f8883bb..3a4d0ad 100644 --- a/framework/yii/db/Connection.php +++ b/framework/yii/db/Connection.php @@ -251,7 +251,7 @@ class Connection extends Component */ private $_schema; - + /** * Returns a value indicating whether the DB connection is established. * @return boolean whether the DB connection is established diff --git a/framework/yii/web/Request.php b/framework/yii/web/Request.php index 5cd6912..a857926 100644 --- a/framework/yii/web/Request.php +++ b/framework/yii/web/Request.php @@ -533,8 +533,8 @@ class Request extends \yii\base\Request */ public function getIsSecureConnection() { - return isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'off') - || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO']==='https'; + return isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] == 1) + || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'; } /**