diff --git a/app/classes/Framadate/Utils.php b/app/classes/Framadate/Utils.php index dc14eca..36f54d2 100644 --- a/app/classes/Framadate/Utils.php +++ b/app/classes/Framadate/Utils.php @@ -23,13 +23,14 @@ class Utils { * @return string Server name */ public static function get_server_name() { - $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; + $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https' : 'http'; $port = in_array($_SERVER['SERVER_PORT'], [80, 443]) ? '' : ':' . $_SERVER['SERVER_PORT']; $dirname = dirname($_SERVER['SCRIPT_NAME']); $dirname = $dirname === '\\' ? '/' : $dirname . '/'; + $dirname = str_replace('/admin', '', $dirname); $server_name = $_SERVER['SERVER_NAME'] . $port . $dirname; - return $scheme . '://' . str_replace('/admin', '', str_replace('//', '/', str_replace('///', '/', $server_name))); + return $scheme . '://' . preg_replace('//+', '/', $server_name); } public static function is_error($cerr) { diff --git a/bandeaux.php b/bandeaux.php index d9c2bd2..b013c8e 100644 --- a/bandeaux.php +++ b/bandeaux.php @@ -27,7 +27,7 @@ function bandeau_titre($titre) $img = ( IMAGE_TITRE ) ? ''.NOMAPPLICATION.'' : ''; echo '
'; - if(count($ALLOWED_LANGUAGES)>1){ + if(count($ALLOWED_LANGUAGES) > 1){ echo '
@@ -38,7 +38,7 @@ function bandeau_titre($titre) '; } echo ' -

'.$img.'

+

' . $img . '

'. $titre .'

@@ -72,7 +72,7 @@ function liste_lang() return $str; } -function bandeau_pied($admin=false) +function bandeau_pied() { echo '