mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Debug v18
This commit is contained in:
@@ -1594,14 +1594,18 @@ function dol_escape_json($stringtoescape)
|
||||
* @param int $keepn 1=Preserve \r\n strings (otherwise, replace them with escaped value). 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 int $escapeonlyhtmltags 1=Escape only html tags, not the special chars like accents.
|
||||
* @param int $cleanalsojavascript Clean also javascript. @TODO switch this option to 1 by default.
|
||||
* @return string Escaped string
|
||||
* @see dol_string_nohtmltag(), dol_string_nospecial(), dol_string_unaccent(), dol_htmlentitiesbr()
|
||||
* @see dol_string_nohtmltag(), dol_string_onlythesehtmltags(), dol_string_nospecial(), dol_string_unaccent(), dol_htmlentitiesbr()
|
||||
*/
|
||||
function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0, $noescapetags = '', $escapeonlyhtmltags = 0)
|
||||
function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0, $noescapetags = '', $escapeonlyhtmltags = 0, $cleanalsojavascript = 0)
|
||||
{
|
||||
if ($noescapetags == 'common') {
|
||||
$noescapetags = 'html,body,a,b,em,hr,i,u,ul,li,br,div,img,font,p,span,strong,table,tr,td,th,tbody';
|
||||
}
|
||||
if ($cleanalsojavascript) {
|
||||
$stringtoescape = dol_string_onlythesehtmltags($stringtoescape, 0, 0, $cleanalsojavascript, 0, array(), 0);
|
||||
}
|
||||
|
||||
// escape quotes and backslashes, newlines, etc.
|
||||
if ($escapeonlyhtmltags) {
|
||||
|
||||
Reference in New Issue
Block a user