diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 4c0dd435634..e70c6116f90 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -176,7 +176,7 @@ if (ini_get('safe_mode') && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) dol_syslog("safe_mode is on, basedir is ".$basedir.", safe_mode_exec_dir is ".ini_get('safe_mode_exec_dir'), LOG_WARNING); } } -print ''; +print ''; print ""; print ''; @@ -187,7 +187,7 @@ print ''.$langs->trans("AntiVirusParam").'
'; print $langs->trans("AntiVirusParamExample"); print ''; print ''; -print ''; +print ''; print ""; print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6a6474c8306..edb27913432 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4446,7 +4446,7 @@ class Form $ret.='\n"; + if (! $silent) print '\n"; dol_syslog('Admin.lib::run_sql Request '.($i+1), LOG_DEBUG); $sqlmodified=0; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cf3b026ed90..5b57c212150 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -517,7 +517,7 @@ function dol_escape_htmltag($stringtoescape,$keepb=0) $tmp=dol_html_entity_decode($stringtoescape,ENT_COMPAT,'UTF-8'); if ($keepb) $tmp=strtr($tmp, array("\r"=>'\\r',"\n"=>'\\n')); else $tmp=strtr($tmp, array("\r"=>'\\r',"\n"=>'\\n',""=>'',''=>'')); - return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8'); + return htmlentities($tmp,ENT_COMPAT,'UTF-8'); } @@ -2473,8 +2473,8 @@ function dol_print_error($db='',$error='') } $out.="".$langs->trans("UserAgent").": ".$_SERVER["HTTP_USER_AGENT"]."
\n"; $out.="
\n"; - $out.="".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"],ENT_COMPAT,'UTF-8')."
\n"; - $out.="".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"])?dol_htmlentities($_SERVER["HTTP_REFERER"],ENT_COMPAT,'UTF-8'):'')."
\n"; + $out.="".$langs->trans("RequestedUrl").": ".htmlentities($_SERVER["REQUEST_URI"],ENT_COMPAT,'UTF-8')."
\n"; + $out.="".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"])?htmlentities($_SERVER["HTTP_REFERER"],ENT_COMPAT,'UTF-8'):'')."
\n"; $out.="".$langs->trans("MenuManager").": ".(isset($conf->standard_menu)?$conf->standard_menu:'')."
\n"; $out.="
\n"; $syslog.="url=".$_SERVER["REQUEST_URI"]; @@ -3859,13 +3859,13 @@ function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0,$pagecodefrom='UTF-8',$ $newstring=preg_replace('//i','
',$newstring); // Replace "
" by "
". It's same and avoid pb with FPDF. if ($removelasteolbr) $newstring=preg_replace('/
$/i','',$newstring); // Remove last
(remove only last one) $newstring=strtr($newstring,array('&'=>'__and__','<'=>'__lt__','>'=>'__gt__','"'=>'__dquot__')); - $newstring=dol_htmlentities($newstring,ENT_COMPAT,$pagecodefrom); // Make entity encoding + $newstring=htmlentities($newstring,ENT_COMPAT,$pagecodefrom); // Make entity encoding $newstring=strtr($newstring,array('__and__'=>'&','__lt__'=>'<','__gt__'=>'>','__dquot__'=>'"')); } else { if ($removelasteolbr) $newstring=preg_replace('/(\r\n|\r|\n)$/i','',$newstring); // Remove last \n (may remove several) - $newstring=dol_nl2br(dol_htmlentities($newstring,ENT_COMPAT,$pagecodefrom),$nl2brmode); + $newstring=dol_nl2br(htmlentities($newstring,ENT_COMPAT,$pagecodefrom),$nl2brmode); } // Other substitutions that htmlentities does not do //$newstring=str_replace(chr(128),'€',$newstring); // 128 = 0x80. Not in html entity table. // Seems useles with TCPDF. Make bug with UTF8 languages diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7be99f5e278..ca32a823d58 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -988,9 +988,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs $appli='Dolibarr'; if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; - if ($title && ! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/noapp/',$conf->global->MAIN_HTML_TITLE)) print ''.dol_htmlentities($title).''; - if ($title) print ''.dol_htmlentities($appli.' - '.$title).''; - else print "".dol_htmlentities($appli).""; + if ($title && ! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/noapp/',$conf->global->MAIN_HTML_TITLE)) print ''.htmlentities($title).''; + if ($title) print ''.htmlentities($appli.' - '.$title).''; + else print "".htmlentities($appli).""; print "\n"; $ext=''; diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 5d32db24d5c..019f739f5fd 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -212,16 +212,16 @@ $adresseadmin=$object->mail_admin; print $langs->trans("Title") .'
'; // Description print ''; @@ -359,7 +359,7 @@ if ($comments) { print ' '.img_picto('', 'delete.png').' '; } - print dol_htmlentities($comment->usercomment).': '.dol_nl2br(dol_htmlentities($comment->comment))."
"; + print htmlentities($comment->usercomment).': '.dol_nl2br(htmlentities($comment->comment))."
"; } } else diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index d13c9884e89..ea17965fa9c 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -153,7 +153,7 @@ while ($i < min($num,$limit)) print ''; print ''; diff --git a/htdocs/opensurvey/public/studs.php b/htdocs/opensurvey/public/studs.php index 1b39391b67c..3050bf0ed08 100644 --- a/htdocs/opensurvey/public/studs.php +++ b/htdocs/opensurvey/public/studs.php @@ -258,7 +258,7 @@ print '
'."\n"; //affichage du titre du sondage $titre=str_replace("\\","",$object->titre); -print ''.dol_htmlentities($titre).'

'."\n"; +print ''.htmlentities($titre).'

'."\n"; //affichage des commentaires du sondage if ($object->commentaires) @@ -362,7 +362,7 @@ if ($object->format=="D") for ($i=0; isset($toutsujet[$i]); $i++) { $heures=explode('@',$toutsujet[$i]); if (isset($heures[1])) { - print '
'."\n"; + print ''."\n"; } else { print ''."\n"; } @@ -418,7 +418,7 @@ while ($compteur < $num) print ''."\n"; // Name - print ''."\n"; + print ''."\n"; // si la ligne n'est pas a changer, on affiche les données if (! $testligneamodifier) @@ -677,7 +677,7 @@ if ($object->allow_spy) { else { $tmps=explode('@',$toutsujet[$i]); - $meilleursujet .= dol_htmlentities($tmps[0]); + $meilleursujet .= htmlentities($tmps[0]); } $compteursujet++; @@ -717,7 +717,7 @@ if ($comments) foreach ($comments as $obj) { print '
'; if (in_array($obj->usercomment, $listofvoters)) print ' '.img_picto('', 'delete.png').' '; - print dol_htmlentities($obj->usercomment).': '.dol_nl2br(dol_htmlentities($obj->comment))."
"; + print htmlentities($obj->usercomment).':'.dol_nl2br(htmlentities($obj->comment)).""; } } diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 226bc0c0465..a543447ffbc 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -451,9 +451,9 @@ $adresseadmin=$object->mail_admin; print $langs->trans("Title") .''; // Expire date @@ -468,7 +468,7 @@ print $langs->trans("Author") .''; @@ -721,7 +721,7 @@ if ($object->format=="D") for ($i = 0; isset($toutsujet[$i]); $i++) { $heures=explode('@', $toutsujet[$i]); if (isset($heures[1])) { - print ''."\n"; + print ''."\n"; } else { print ''."\n"; } @@ -744,7 +744,7 @@ else for ($i = 0; isset($toutsujet[$i]); $i++) { $tmp=explode('@',$toutsujet[$i]); - print ''."\n"; + print ''."\n"; } print ''."\n"; @@ -780,7 +780,7 @@ while ($compteur < $num) } // Name - print ''."\n"; + print ''."\n"; // si la ligne n'est pas a changer, on affiche les données if (! $testligneamodifier) @@ -1047,7 +1047,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) { else { $tmps=explode('@',$toutsujet[$i]); - $meilleursujet .= dol_htmlentities($tmps[0]); + $meilleursujet .= htmlentities($tmps[0]); } $compteursujet++;
'; } - $ret.=dol_htmlentities($object->$fieldref); + $ret.=htmlentities($object->$fieldref); if ($morehtmlref) { $ret.=' '.$morehtmlref; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index a54cb5fcc79..54f2748cfd1 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -249,7 +249,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker $newsql=preg_replace('/__ENTITY__/i',(!empty($entity)?$entity:$conf->entity),$sql); // Ajout trace sur requete (eventuellement a commenter si beaucoup de requetes) - if (! $silent) print '
'.$langs->trans("Request").' '.($i+1)." sql='".dol_htmlentities($newsql,ENT_NOQUOTES)."'
'.$langs->trans("Request").' '.($i+1)." sql='".htmlentities($newsql,ENT_NOQUOTES)."'
'; if ($action == 'edit') { - print ''; + print ''; } -else print dol_htmlentities($object->titre); +else print htmlentities($object->titre); print '
'.$langs->trans("Description") .''; if ($action == 'edit') { - $doleditor=new DolEditor('nouveauxcommentaires', dol_htmlentities($object->commentaires),'',120,'dolibarr_notes','In',1,1,1,ROWS_7,120); + $doleditor=new DolEditor('nouveauxcommentaires', htmlentities($object->commentaires),'',120,'dolibarr_notes','In',1,1,1,ROWS_7,120); $doleditor->Create(0,''); } else @@ -229,7 +229,7 @@ else if (empty($conf->fckeditor->enabled)) print dol_htmlentitiesbr($object->commentaires); else { - $doleditor=new DolEditor('nouveauxcommentaires', dol_htmlentities($object->commentaires),'',120,'dolibarr_notes','In',1,1,1,ROWS_7,120,1); + $doleditor=new DolEditor('nouveauxcommentaires', htmlentities($object->commentaires),'',120,'dolibarr_notes','In',1,1,1,ROWS_7,120,1); $doleditor->Create(0,''); } } @@ -295,7 +295,7 @@ print $langs->trans("Author") .''; if ($object->fk_user_creat) { print $userstatic->getLoginUrl(1); } else { - print dol_htmlentities($object->nom_admin); + print htmlentities($object->nom_admin); } print '
'; print ''.img_picto('','object_opensurvey').' '.$obj->id_sondage.''; - print ''.dol_htmlentities($obj->titre).''; + print ''.htmlentities($obj->titre).''; $type=($obj->format=='A')?'classic':'date'; print img_picto('',dol_buildpath('/opensurvey/img/'.($type == 'classic'?'chart-32.png':'calendar-32.png'),1),'width="16"',1); print ' '.$langs->trans($type=='classic'?"TypeClassic":"TypeDate"); @@ -169,7 +169,7 @@ while ($i < min($num,$limit)) print $userstatic->getLoginUrl(1); } else { - print dol_htmlentities($obj->nom_admin); + print htmlentities($obj->nom_admin); } print ''.dol_htmlentities($heures[1]).''.htmlentities($heures[1]).'
'.dol_htmlentities($obj->name).''.htmlentities($obj->name).' '; if ($action == 'edit') { - print ''; + print ''; } -else print dol_htmlentities($object->titre); +else print htmlentities($object->titre); print '
'; if ($object->fk_user_creat) { print $userstatic->getLoginUrl(1); } else { - print dol_htmlentities($object->nom_admin); + print htmlentities($object->nom_admin); } print '
'.dol_htmlentities($heures[1]).''.htmlentities($heures[1]).''.dol_htmlentities($tmp[0]).''.htmlentities($tmp[0]).''.img_picto('',dol_buildpath('/opensurvey/img/add-16.png',1),'',1).''.dol_htmlentities($obj->name).''.htmlentities($obj->name).'