Skip to content
Snippets Groups Projects
Commit 26714386 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

moved function and fixed whitespace errors

parent 6aad717e
No related branches found
No related tags found
No related merge requests found
...@@ -3,13 +3,6 @@ ...@@ -3,13 +3,6 @@
* Initialize some defaults needed for DokuWiki * 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 * timing Dokuwiki execution
...@@ -487,23 +480,31 @@ function getBaseURL($abs=null){ ...@@ -487,23 +480,31 @@ function getBaseURL($abs=null){
* *
* @returns bool true when SSL is active * @returns bool true when SSL is active
*/ */
function is_ssl(){ function is_ssl() {
// check if we are behind a reverse proxy // check if we are behind a reverse proxy
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { if(isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { if($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
return true; return true;
} else { } else {
return false; return false;
} }
} }
if (!isset($_SERVER['HTTPS']) || if(!isset($_SERVER['HTTPS']) ||
preg_match('/^(|off|false|disabled)$/i',$_SERVER['HTTPS'])){ preg_match('/^(|off|false|disabled)$/i', $_SERVER['HTTPS'])) {
return false; return false;
}else{ } else {
return true; 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. * print a nice message even if no styles are loaded yet.
* *
......
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