Fix warnings

This commit is contained in:
Laurent Destailleur 2023-10-24 15:40:36 +02:00
parent ab775998d1
commit 70e475d0ce
2 changed files with 6 additions and 4 deletions

View File

@ -64,7 +64,9 @@ if (!empty($conf->dol_use_jmobile)) {
}
$php_self = empty($php_self) ? dol_escape_htmltag($_SERVER['PHP_SELF']) : $php_self;
$php_self .= dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '';
if (!empty($_SERVER["QUERY_STRING"]) && dol_escape_htmltag($_SERVER["QUERY_STRING"])) {
$php_self .= '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]);
}
if (!preg_match('/mainmenu=/', $php_self)) {
$php_self .= (preg_match('/\?/', $php_self) ? '&' : '?').'mainmenu=home';
}
@ -136,7 +138,7 @@ $(document).ready(function () {
<div class="login_center center"<?php
if (empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
$backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
$backstyle = 'background: linear-gradient('.((!empty($conf->browser->layout) && $conf->browser->layout == 'phone') ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
// old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
$backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; '.$backstyle.'"' : '';

View File

@ -898,7 +898,7 @@ if (!defined('NOLOGIN')) {
//top_httphead();
return 'ERROR_NOT_LOGGED';
} else {
if ($_SERVER["HTTP_USER_AGENT"] == 'securitytest') {
if (!empty($_SERVER["HTTP_USER_AGENT"]) && $_SERVER["HTTP_USER_AGENT"] == 'securitytest') {
http_response_code(401); // It makes easier to understand if session was broken during security tests
}
dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers
@ -1663,7 +1663,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
}
$hookmanager->initHooks(array("main"));
$ext = 'layout='.$conf->browser->layout.'&amp;version='.urlencode(DOL_VERSION);
$ext = 'layout='.(empty($conf->browser->layout) ? '' : $conf->browser->layout).'&amp;version='.urlencode(DOL_VERSION);
print "<head>\n";