2
0
forked from Wavyzz/dolibarr

Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2023-10-12 15:01:26 +02:00
6 changed files with 60 additions and 10 deletions

View File

@@ -1594,6 +1594,43 @@ function dol_escape_json($stringtoescape)
return str_replace('"', '\"', $stringtoescape);
}
/**
* Return a string label ready to be output on HTML content
* To use text inside an attribute, use can use only dol_escape_htmltag()
*
* @param string $s String to print
* @return string String ready for HTML output
*/
function dolPrintLabel($s)
{
return dol_escape_htmltag(dol_htmlentitiesbr($s));
}
/**
* Return a string ready to be output on HTML page
* To use text inside an attribute, use can use only dol_escape_htmltag()
*
* @param string $s String to print
* @return string String ready for HTML output
*/
function dolPrintHTML($s)
{
return dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($s), 1, 1, 1)), 1, 1, 'common', 0, 1);
}
/**
* Return a string ready to be output on input textarea
* To use text inside an attribute, use can use only dol_escape_htmltag()
*
* @param string $s String to print
* @return string String ready for HTML output into a textarea
*/
function dolPrintHTMLForTextArea($s)
{
return dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($s), 1, 1, 1)), 1, 1, '', 0, 1);
}
/**
* Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input fields.
* When we output string on pages, we use
@@ -1626,7 +1663,7 @@ function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0, $noescapeta
$tmp = html_entity_decode((string) $stringtoescape, ENT_COMPAT, 'UTF-8');
}
if (!$keepb) {
$tmp = strtr($tmp, array("<b>"=>'', '</b>'=>''));
$tmp = strtr($tmp, array("<b>"=>'', '</b>'=>'', '<strong>'=>'', '</strong>'=>''));
}
if (!$keepn) {
$tmp = strtr($tmp, array("\r"=>'\\r', "\n"=>'\\n'));
@@ -7205,7 +7242,7 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto =
* @param int $cleanalsojavascript Remove also occurence of 'javascript:'.
* @param int $allowiframe Allow iframe tags.
* @param array $allowed_tags List of allowed tags to replace the default list
* @param int $allowlink Allow link tags.
* @param int $allowlink Allow "link" tags.
* @return string String cleaned
*
* @see dol_htmlwithnojs() dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_neverthesehtmltags()