Update to the baseurl check in the health tool

- https was checked incorrectly before
pull/304/merge
iglocska 2014-10-02 11:00:30 +02:00
parent 50b1676fe8
commit 0e2d8e9a55
1 changed files with 1 additions and 1 deletions

View File

@ -916,7 +916,7 @@ class Server extends AppModel {
}
public function testBaseURL($value) {
if ($this->testForEmpty($value) !== true) return $this->testForEmpty($value);
$protocol = stripos($_SERVER['SERVER_PROTOCOL'],'https') === true ? 'HTTPS' : 'HTTP';
$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) === true ? 'HTTPS' : 'HTTP';
if ($value != strtolower($protocol) . '://' . $_SERVER[$protocol . '_HOST']) return false;
return true;
}