Skip to content
Snippets Groups Projects
Commit ad52a53e authored by Olav Morken's avatar Olav Morken
Browse files

Remove Utilities::getSelfProtocol().

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2390 44740490-163a-0410-bde0-09ae8108e29a
parent 6f6ae346
No related branches found
No related tags found
No related merge requests found
...@@ -50,17 +50,6 @@ class SimpleSAML_Utilities { ...@@ -50,17 +50,6 @@ class SimpleSAML_Utilities {
return $currenthost;# . self::getFirstPathElement() ; return $currenthost;# . self::getFirstPathElement() ;
} }
/**
* Will return https
*/
public static function getSelfProtocol() {
$s = empty($_SERVER["HTTPS"]) ? ''
: ($_SERVER["HTTPS"] == "on") ? 's'
: '';
if ( empty($_SERVER["HTTPS"]) && $_SERVER["SERVER_PORT"] == 443) $s = 's';
$protocol = self::strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
return $protocol;
}
/** /**
* Will return https://sp.example.org * Will return https://sp.example.org
...@@ -68,8 +57,12 @@ class SimpleSAML_Utilities { ...@@ -68,8 +57,12 @@ class SimpleSAML_Utilities {
public static function selfURLhost() { public static function selfURLhost() {
$currenthost = self::getSelfHost(); $currenthost = self::getSelfHost();
$protocol = self::getSelfProtocol(); if (SimpleSAML_Utilities::isHTTPS()) {
$protocol = 'https';
} else {
$protocol = 'http';
}
$portnumber = $_SERVER["SERVER_PORT"]; $portnumber = $_SERVER["SERVER_PORT"];
$port = ':' . $portnumber; $port = ':' . $portnumber;
......
...@@ -16,7 +16,7 @@ $isadmin = SimpleSAML_Utilities::isAdmin(); ...@@ -16,7 +16,7 @@ $isadmin = SimpleSAML_Utilities::isAdmin();
$warnings = array(); $warnings = array();
if (SimpleSAML_Utilities::getSelfProtocol() != 'https') { if (!SimpleSAML_Utilities::isHTTPS()) {
$warnings[] = '{core:frontpage:warnings_https}'; $warnings[] = '{core:frontpage:warnings_https}';
} }
......
...@@ -22,7 +22,6 @@ $attributes['SERVER_PROTOCOL'] = array($_SERVER['SERVER_PROTOCOL']); ...@@ -22,7 +22,6 @@ $attributes['SERVER_PROTOCOL'] = array($_SERVER['SERVER_PROTOCOL']);
$attributes['SERVER_PORT'] = array($_SERVER['SERVER_PORT']); $attributes['SERVER_PORT'] = array($_SERVER['SERVER_PORT']);
$attributes['Utilities_getSelfHost()'] = array(SimpleSAML_Utilities::getSelfHost()); $attributes['Utilities_getSelfHost()'] = array(SimpleSAML_Utilities::getSelfHost());
$attributes['Utilities_getSelfProtocol()'] = array(SimpleSAML_Utilities::getSelfProtocol());
$attributes['Utilities_selfURLhost()'] = array(SimpleSAML_Utilities::selfURLhost()); $attributes['Utilities_selfURLhost()'] = array(SimpleSAML_Utilities::selfURLhost());
$attributes['Utilities_selfURLNoQuery()'] = array(SimpleSAML_Utilities::selfURLNoQuery()); $attributes['Utilities_selfURLNoQuery()'] = array(SimpleSAML_Utilities::selfURLNoQuery());
$attributes['Utilities_getScriptName()'] = array(SimpleSAML_Utilities::getScriptName()); $attributes['Utilities_getScriptName()'] = array(SimpleSAML_Utilities::getScriptName());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment