moved function and fixed whitespace errors

This commit is contained in:
Andreas Gohr 2017-08-27 12:33:12 +02:00
parent 6aad717e42
commit 267143863b
1 changed files with 18 additions and 17 deletions

View File

@ -3,13 +3,6 @@
* Initialize some defaults needed for DokuWiki
*/
/**
* checks it is windows OS
* @return bool
*/
function isWindows() {
return (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false;
}
/**
* timing Dokuwiki execution
@ -487,23 +480,31 @@ function getBaseURL($abs=null){
*
* @returns bool true when SSL is active
*/
function is_ssl(){
function is_ssl() {
// check if we are behind a reverse proxy
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
return true;
} else {
return false;
}
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
if($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
return true;
} else {
return false;
}
}
if (!isset($_SERVER['HTTPS']) ||
preg_match('/^(|off|false|disabled)$/i',$_SERVER['HTTPS'])){
if(!isset($_SERVER['HTTPS']) ||
preg_match('/^(|off|false|disabled)$/i', $_SERVER['HTTPS'])) {
return false;
}else{
} else {
return true;
}
}
/**
* checks it is windows OS
* @return bool
*/
function isWindows() {
return (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false;
}
/**
* print a nice message even if no styles are loaded yet.
*