Fix #yogosha20850

This commit is contained in:
Laurent Destailleur
2024-02-17 20:53:56 +01:00
parent 044d14ce2e
commit 3f99cce347
2 changed files with 10 additions and 8 deletions

View File

@@ -1738,7 +1738,7 @@ function dolPrintPassword($s)
* - dolPrintPassword that is abelhtmlspecialchars( , ENT_COMPAT, 'UTF-8') for passwords. * - dolPrintPassword that is abelhtmlspecialchars( , ENT_COMPAT, 'UTF-8') for passwords.
* *
* @param string $stringtoescape String to escape * @param string $stringtoescape String to escape
* @param int $keepb 1=Keep b tags, 0=remove them completely * @param int $keepb 1=Replace b tags with escaped value (except if in $noescapetags), 0=Remove them completely
* @param int $keepn 1=Preserve \r\n strings, 0=Replace them with escaped value, -1=Remove them. Set to 1 when escaping for a <textarea>. * @param int $keepn 1=Preserve \r\n strings, 0=Replace them with escaped value, -1=Remove them. Set to 1 when escaping for a <textarea>.
* @param string $noescapetags '' or 'common' or list of tags to not escape. TODO Does not works yet when there is attributes into tag. * @param string $noescapetags '' or 'common' or list of tags to not escape. TODO Does not works yet when there is attributes into tag.
* @param int $escapeonlyhtmltags 1=Escape only html tags, not the special chars like accents. * @param int $escapeonlyhtmltags 1=Escape only html tags, not the special chars like accents.
@@ -5340,7 +5340,7 @@ function img_searchclear($titlealt = 'default', $other = '')
} }
/** /**
* Show information for admin users or standard users * Show information in HTML for admin users or standard users
* *
* @param string $text Text info * @param string $text Text info
* @param integer $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto * @param integer $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto
@@ -5362,7 +5362,9 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss
} }
$class = (empty($admin) ? 'undefined' : ($admin == '1' ? 'info' : $admin)); $class = (empty($admin) ? 'undefined' : ($admin == '1' ? 'info' : $admin));
$result = ($nodiv ? '' : '<div class="'.$class.($morecss ? ' '.$morecss : '').($textfordropdown ? ' hidden' : '').'">').'<span class="fa fa-info-circle" title="'.dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')).'"></span> '.$text.($nodiv ? '' : '</div>'); $result = ($nodiv ? '' : '<div class="'.$class.($morecss ? ' '.$morecss : '').($textfordropdown ? ' hidden' : '').'">').'<span class="fa fa-info-circle" title="'.dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')).'"></span> ';
$result .= dol_escape_htmltag($text, 1, 0, 'div,span,b');
$result .= ($nodiv ? '' : '</div>');
if ($textfordropdown) { if ($textfordropdown) {
$tmpresult = '<span class="'.$class.'text opacitymedium cursorpointer">'.$langs->trans($textfordropdown).' '.img_picto($langs->trans($textfordropdown), '1downarrow').'</span>'; $tmpresult = '<span class="'.$class.'text opacitymedium cursorpointer">'.$langs->trans($textfordropdown).' '.img_picto($langs->trans($textfordropdown), '1downarrow').'</span>';

View File

@@ -120,7 +120,7 @@ if (!getDolGlobalString('MAIN_REMOVE_INSTALL_WARNING')) {
if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) { if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) {
$langs->load("errors"); $langs->load("errors");
//if (!empty($message)) $message.='<br>'; //if (!empty($message)) $message.='<br>';
$message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); $message .= info_admin($langs->transnoentities("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->transnoentities("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth');
} }
// Conf files must be in read only mode // Conf files must be in read only mode
@@ -128,7 +128,7 @@ if (!getDolGlobalString('MAIN_REMOVE_INSTALL_WARNING')) {
$langs->load("errors"); $langs->load("errors");
//$langs->load("other"); //$langs->load("other");
//if (!empty($message)) $message.='<br>'; //if (!empty($message)) $message.='<br>';
$message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); $message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->transnoentities("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth');
} }
$object = new stdClass(); $object = new stdClass();
@@ -137,9 +137,9 @@ if (!getDolGlobalString('MAIN_REMOVE_INSTALL_WARNING')) {
if ($reshook == 0) { if ($reshook == 0) {
$message .= $hookmanager->resPrint; $message .= $hookmanager->resPrint;
} }
if ($message) { if ($message) { // $message is an HTML string.
print $message.'<br>'; print dol_string_onlythesehtmltags($message, 1, 0, 0, 0, array('div', 'span', 'b'));
//$message.='<br>'; print '<br>';
//print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install")); //print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install"));
} }
} }