Changeset 623
- Timestamp:
- Feb 17, 2018 10:59:13 AM (6 years ago)
- Location:
- trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r610 r623 468 468 // Not available on CLI scripts obviously. 469 469 if (isset($_SERVER['HTTP_HOST']) && '' != $_SERVER['HTTP_HOST'] && '' == $this->getParam('site_url')) { 470 $this->setParam(array('site_url' => sprintf('%s://%s', ( 'on' ==getenv('HTTPS') ? 'https' : 'http'), getenv('HTTP_HOST'))));470 $this->setParam(array('site_url' => sprintf('%s://%s', (getenv('HTTPS') ? 'https' : 'http'), getenv('HTTP_HOST')))); 471 471 } 472 472 … … 474 474 // Also not available on CLI scripts obviously. 475 475 if (isset($_SERVER['HTTP_HOST']) && '' != $_SERVER['HTTP_HOST']) { 476 $this->setParam(array('page_url' => sprintf('%s://%s%s', ( 'on' ==getenv('HTTPS') ? 'https' : 'http'), getenv('HTTP_HOST'), getenv('REQUEST_URI'))));476 $this->setParam(array('page_url' => sprintf('%s://%s%s', (getenv('HTTPS') ? 'https' : 'http'), getenv('HTTP_HOST'), getenv('REQUEST_URI')))); 477 477 } 478 478 … … 1368 1368 if (preg_match('!^/!', $url)) { 1369 1369 // If relative URL is given, prepend correct local hostname. 1370 $scheme = 'on' ==getenv('HTTPS') ? 'https' : 'http';1370 $scheme = getenv('HTTPS') ? 'https' : 'http'; 1371 1371 $host = getenv('HTTP_HOST'); 1372 1372 $url = sprintf('%s://%s%s', $scheme, $host, $url); … … 1612 1612 } 1613 1613 1614 if ( '' ==getenv('HTTPS') && $this->getParam('ssl_enabled') && in_array('mod_ssl', $modules)) {1614 if (!getenv('HTTPS') && $this->getParam('ssl_enabled') && in_array('mod_ssl', $modules)) { 1615 1615 $this->raiseMsg(sprintf(_("Secure SSL connection made to %s"), $this->getParam('ssl_domain')), MSG_NOTICE, __FILE__, __LINE__); 1616 1616 // Always append session because some browsers do not send cookie when crossing to SSL URL. … … 1657 1657 // Defaults. 1658 1658 $expire = (is_numeric($expire) ? $expire : (is_string($expire) ? strtotime($expire) : $expire)); 1659 $secure = $secure ?: ( '' !=getenv('HTTPS') && $this->getParam('ssl_enabled'));1659 $secure = $secure ?: (getenv('HTTPS') && $this->getParam('ssl_enabled')); 1660 1660 $httponly = $httponly ?: true; 1661 1661 -
trunk/lib/Utilities.inc.php
r613 r623 1426 1426 function absoluteMe() 1427 1427 { 1428 $protocol = ('on' == getenv('HTTPS')) ? 'https://' : 'http://'; 1429 return $protocol . getenv('HTTP_HOST') . getenv('REQUEST_URI'); 1428 return sprintf('%s://%s%s', (getenv('HTTPS') ? 'https' : 'http'), getenv('HTTP_HOST'), getenv('REQUEST_URI')); 1430 1429 } 1431 1430
Note: See TracChangeset
for help on using the changeset viewer.