diff --git a/application/utils.inc.php b/application/utils.inc.php index 3ab30d204..a039a098b 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -240,7 +240,7 @@ class utils } else { - $sProtocol = isset($_SERVER['HTTPS']) ? 'https' : 'http'; + $sProtocol = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!="off")) ? 'https' : 'http'; if ($sProtocol == 'http') { $sPort = ($_SERVER['SERVER_PORT'] == 80) ? '' : ':'.$_SERVER['SERVER_PORT']; diff --git a/pages/opensearch.xml.php b/pages/opensearch.xml.php index 68c7393db..648509546 100644 --- a/pages/opensearch.xml.php +++ b/pages/opensearch.xml.php @@ -23,9 +23,9 @@ * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL */ - $sFullUrl = 'http'.(empty($_SERVER['HTTPS']) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/UI.php'; - $sICOFullUrl = 'http'.(empty($_SERVER['HTTPS']) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../images/iTop-icon.ico'; - $sPNGFullUrl = 'http'.(empty($_SERVER['HTTPS']) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../images/iTop-icon.png'; + $sFullUrl = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/UI.php'; + $sICOFullUrl = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../images/iTop-icon.ico'; + $sPNGFullUrl = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../images/iTop-icon.png'; header('Content-type: text/xml'); ?> diff --git a/webservices/export.php b/webservices/export.php index 3a63fa9b3..80d85ab36 100644 --- a/webservices/export.php +++ b/webservices/export.php @@ -59,7 +59,7 @@ if (!empty($sExpression)) // since this page is in a different folder, let's adjust the HTML 'base' attribute // to make the relative hyperlinks in the page work $sServerName = $_SERVER['SERVER_NAME']; - $sProtocol = isset($_SERVER['HTTPS']) ? 'https' : 'http'; + $sProtocol = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? 'https' : 'http'; if ($sProtocol == 'http') { $sPort = ($_SERVER['SERVER_PORT'] == 80) ? '' : ':'.$_SERVER['SERVER_PORT']; diff --git a/webservices/itop.wsdl.php b/webservices/itop.wsdl.php index 5590e0d2d..3a1a46fd4 100644 --- a/webservices/itop.wsdl.php +++ b/webservices/itop.wsdl.php @@ -33,7 +33,7 @@ $sMyWsdl = './itop.wsdl.tpl'; $sRawFile = file_get_contents($sMyWsdl); -$sServerURI = 'http'.(empty($_SERVER['HTTPS']) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/soapserver.php'; +$sServerURI = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/soapserver.php'; $sFinalFile = str_replace( '___SOAP_SERVER_URI___', diff --git a/webservices/itopsoap.examples.php b/webservices/itopsoap.examples.php index 982aec523..e2c151cad 100644 --- a/webservices/itopsoap.examples.php +++ b/webservices/itopsoap.examples.php @@ -26,7 +26,7 @@ require_once('itopsoaptypes.class.inc.php'); -$sItopRoot = 'http'.(empty($_SERVER['HTTPS']) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/..'; +$sItopRoot = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/..'; $sWsdlUri = $sItopRoot.'/webservices/itop.wsdl.php'; ini_set("soap.wsdl_cache_enabled","0"); diff --git a/webservices/soapserver.php b/webservices/soapserver.php index 077fc25cc..64ec33058 100644 --- a/webservices/soapserver.php +++ b/webservices/soapserver.php @@ -32,7 +32,7 @@ require_once('../application/startup.inc.php'); require('./webservices.class.inc.php'); // this file is generated dynamically with location = here -$sWsdlUri = 'http'.(empty($_SERVER['HTTPS']) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../webservices/itop.wsdl.php'; +$sWsdlUri = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../webservices/itop.wsdl.php'; ini_set("soap.wsdl_cache_enabled","0");