diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php
index 4135e982d14..3cc0aa41007 100644
--- a/htdocs/accountancy/class/accountingjournal.class.php
+++ b/htdocs/accountancy/class/accountingjournal.class.php
@@ -189,9 +189,9 @@ class AccountingJournal extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAccountingJournal");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip"';
}
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index f8573c3f75e..f34694ef5bc 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -529,9 +529,9 @@ class BookKeeping extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowTransaction");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php
index b8d13a37377..8bd3a2013ea 100644
--- a/htdocs/adherents/admin/member.php
+++ b/htdocs/adherents/admin/member.php
@@ -469,7 +469,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'contract').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index a401823fc3c..42c1f192825 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -2382,9 +2382,9 @@ class Adherent extends CommonObject
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$langs->load("users");
$label = $langs->trans("ShowUser");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
}
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 2947f20b158..cf33af23343 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -780,7 +780,7 @@ class AdherentType extends CommonObject
}
}
$linkstart = '';
$linkend = '';
diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php
index c6aad6f2e1c..18b5dff4645 100644
--- a/htdocs/admin/bank.php
+++ b/htdocs/admin/bank.php
@@ -421,7 +421,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php
index 484547fbcfe..1c28ed4c482 100644
--- a/htdocs/admin/bom.php
+++ b/htdocs/admin/bom.php
@@ -428,7 +428,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index f60f8cb8d44..cf91b5fb5cb 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -464,7 +464,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php
index 8cbc9a19cf3..f8d6c1730ad 100644
--- a/htdocs/admin/delivery.php
+++ b/htdocs/admin/delivery.php
@@ -464,7 +464,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index 45c74c98523..3fcfa7c7b36 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -416,7 +416,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php
index 65434761dfb..31087976ffc 100644
--- a/htdocs/admin/expensereport.php
+++ b/htdocs/admin/expensereport.php
@@ -435,7 +435,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index 1da1132f262..9e04a9894da 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -511,7 +511,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php
index d8c7cc97a76..18b7ac33f6d 100644
--- a/htdocs/admin/holiday.php
+++ b/htdocs/admin/holiday.php
@@ -427,7 +427,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php
index d94d434ed8b..6671a5b68ad 100644
--- a/htdocs/admin/hrm.php
+++ b/htdocs/admin/hrm.php
@@ -479,7 +479,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php
index 3a616082823..736078cd4cf 100644
--- a/htdocs/admin/invoice.php
+++ b/htdocs/admin/invoice.php
@@ -616,7 +616,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php
index dccddf00291..ffd63bb379c 100644
--- a/htdocs/admin/knowledgemanagement.php
+++ b/htdocs/admin/knowledgemanagement.php
@@ -597,7 +597,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php
index 9a55acfe90f..bf7c39d8b9a 100644
--- a/htdocs/admin/mrp.php
+++ b/htdocs/admin/mrp.php
@@ -425,7 +425,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php
index ebad20367b1..d915eda1693 100644
--- a/htdocs/admin/order.php
+++ b/htdocs/admin/order.php
@@ -517,7 +517,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php
index 419a8b96384..a4771a9013b 100644
--- a/htdocs/admin/paymentbybanktransfer.php
+++ b/htdocs/admin/paymentbybanktransfer.php
@@ -362,7 +362,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print img_object($langs->trans("PreviewNotAvailable"),'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"),'generic');
}
print '';
diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php
index 702e1a77d4f..90a150ba6bc 100644
--- a/htdocs/admin/prelevement.php
+++ b/htdocs/admin/prelevement.php
@@ -377,7 +377,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print img_object($langs->trans("PreviewNotAvailable"),'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"),'generic');
}
print '';
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index 5b68c10a838..49ca75ee0a1 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -494,7 +494,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php
index 88dc292538b..7c1c855dc0a 100644
--- a/htdocs/admin/reception_setup.php
+++ b/htdocs/admin/reception_setup.php
@@ -429,7 +429,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php
index 7e87218c977..78590db9795 100644
--- a/htdocs/admin/stock.php
+++ b/htdocs/admin/stock.php
@@ -664,7 +664,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/stocktransfer.php b/htdocs/admin/stocktransfer.php
index 4b5b7e3ad8e..e1281c1bf58 100644
--- a/htdocs/admin/stocktransfer.php
+++ b/htdocs/admin/stocktransfer.php
@@ -481,7 +481,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'generic').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php
index 51422388cd4..4c3fc9ee12c 100644
--- a/htdocs/admin/supplier_proposal.php
+++ b/htdocs/admin/supplier_proposal.php
@@ -483,7 +483,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php
index a67844e31bc..1ae98d5a5ec 100644
--- a/htdocs/admin/ticket.php
+++ b/htdocs/admin/ticket.php
@@ -489,7 +489,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php
index bbc06499e6e..0c957617ce1 100644
--- a/htdocs/admin/user.php
+++ b/htdocs/admin/user.php
@@ -163,9 +163,9 @@ print '';
print '
';
print '| '.$langs->trans("UserMailRequired").' | ';
-print ' | ';
+print ' | ';
-print '';
+print ' | ';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('USER_MAIL_REQUIRED');
} else {
@@ -181,9 +181,9 @@ print ' |
';
print '';
print '| '.$langs->trans("UserHideInactive").' | ';
-print ' | ';
+print ' | ';
-print '';
+print ' | ';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('USER_HIDE_INACTIVE_IN_COMBOBOX');
} else {
@@ -325,7 +325,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print ' | ';
diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php
index b9fb8c42608..fbaa912385a 100644
--- a/htdocs/admin/usergroup.php
+++ b/htdocs/admin/usergroup.php
@@ -244,7 +244,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php
index 7a346161188..f05467d68da 100644
--- a/htdocs/admin/workstation.php
+++ b/htdocs/admin/workstation.php
@@ -474,7 +474,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'generic').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php
index 963f7837314..22e36b47bda 100644
--- a/htdocs/asset/admin/setup.php
+++ b/htdocs/asset/admin/setup.php
@@ -447,7 +447,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php
index 9dc62995ffc..75566f379a7 100644
--- a/htdocs/asset/class/asset.class.php
+++ b/htdocs/asset/class/asset.class.php
@@ -1408,9 +1408,9 @@ class Asset extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAsset");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php
index 753b89a4a35..56852c052d6 100644
--- a/htdocs/asset/class/assetmodel.class.php
+++ b/htdocs/asset/class/assetmodel.class.php
@@ -619,9 +619,9 @@ class AssetModel extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAssetModel");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php
index b6fa70ade31..f204993c892 100644
--- a/htdocs/bom/class/bom.class.php
+++ b/htdocs/bom/class/bom.class.php
@@ -1159,9 +1159,9 @@ class BOM extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowBillOfMaterials");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/bom/class/bomline.class.php b/htdocs/bom/class/bomline.class.php
index 92328b09fcd..5ebd98a756c 100644
--- a/htdocs/bom/class/bomline.class.php
+++ b/htdocs/bom/class/bomline.class.php
@@ -387,9 +387,9 @@ class BOMLine extends CommonObjectLine
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowBillOfMaterialsLine");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php
index 1c5b7c78424..d072343caae 100644
--- a/htdocs/bookcal/class/availabilities.class.php
+++ b/htdocs/bookcal/class/availabilities.class.php
@@ -756,9 +756,9 @@ class Availabilities extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAvailabilities");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php
index a1acf818ba9..c96fbe2da34 100644
--- a/htdocs/bookcal/class/calendar.class.php
+++ b/htdocs/bookcal/class/calendar.class.php
@@ -742,9 +742,9 @@ class Calendar extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowCalendar");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php
index a386876a7d6..f58d1839389 100644
--- a/htdocs/bookmarks/class/bookmark.class.php
+++ b/htdocs/bookmarks/class/bookmark.class.php
@@ -319,9 +319,9 @@ class Bookmark extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowBookmark");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index 09e0cb52c47..21a642afd22 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -1811,9 +1811,9 @@ class Categorie extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.' '.$forced_color.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ' class="'.$forced_color.($morecss ? ' '.$morecss : '').'"';
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 249e342d5fc..a96ec4e0e82 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -1658,6 +1658,7 @@ class ActionComm extends CommonObject
$datas['note'] .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '
', $texttoshow));
$datas['note'] .= '';
}
+
// show categories for this record only in ajax to not overload lists
if (isModEnabled('category') && !$nofetch) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
@@ -1767,6 +1768,7 @@ class ActionComm extends CommonObject
$tooltip .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '
', $texttoshow));
$tooltip .= '';
}
+
$linkclose = '';
$classfortooltip = 'classfortooltip';
$dataparams = '';
@@ -1784,9 +1786,9 @@ class ActionComm extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAction");
- $linkclose .= ' alt="'.dol_escape_htmltag($tooltip, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHTMLForAttribute($tooltip).'"';
}
- $linkclose .= ($tooltip ? ' title="'.dol_escape_htmltag($tooltip, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($tooltip ? ' title="'.dolPrintHTMLForAttribute($tooltip).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classname.' '.$classfortooltip.'"';
} else {
$linkclose .= ' class="'.$classname.'"';
diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php
index facaec0753f..d86745f21e9 100644
--- a/htdocs/comm/mailing/class/mailing.class.php
+++ b/htdocs/comm/mailing/class/mailing.class.php
@@ -852,9 +852,9 @@ class Mailing extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowEMailing");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 6c4b0d8413a..c8689e9f904 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -3831,9 +3831,9 @@ class Propal extends CommonObject
if (empty($notooltip) && $user->hasRight('propal', 'lire')) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("Proposal");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index b3b59879276..6a7418d81ca 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3899,9 +3899,9 @@ class Commande extends CommonOrder
if (empty($notooltip) && $user->hasRight('commande', 'lire')) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("Order");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
$target_value = array('_self', '_blank', '_parent', '_top');
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 73ee30a83fe..37050661838 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -1597,9 +1597,9 @@ class Account extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("BankAccount");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php
index 1fa01691f34..b474592d93d 100644
--- a/htdocs/compta/bank/class/paymentvarious.class.php
+++ b/htdocs/compta/bank/class/paymentvarious.class.php
@@ -724,9 +724,9 @@ class PaymentVarious extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php
index d2bbbf5b545..0e71db22c62 100644
--- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php
+++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php
@@ -463,9 +463,9 @@ class CashControl extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 91eb3f25145..62eb4464566 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -2109,9 +2109,9 @@ class Facture extends CommonInvoice
if (empty($notooltip) && $user->hasRight("facture", "read")) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("Invoice");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}
diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
index 17527a26591..fae7d4894aa 100644
--- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
@@ -964,9 +964,9 @@ class RemiseCheque extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowCheckReceipt");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index cbe1c9b4111..29b19528619 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -1415,9 +1415,9 @@ class Paiement extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("Payment");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php
index fcfffab7b7c..7e64a35e963 100644
--- a/htdocs/compta/sociales/class/chargesociales.class.php
+++ b/htdocs/compta/sociales/class/chargesociales.class.php
@@ -688,9 +688,9 @@ class ChargeSociales extends CommonObject
if (empty($notooltip) && $user->hasRight("facture", "read")) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("SocialContribution");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip"';
}
diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php
index 9ed504b6a13..1b68ceaf8ae 100644
--- a/htdocs/compta/tva/class/tva.class.php
+++ b/htdocs/compta/tva/class/tva.class.php
@@ -783,9 +783,9 @@ class Tva extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 082639332be..1e19a39b9f6 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -1571,9 +1571,9 @@ class Contact extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowContact");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 8999641d19a..a83b98fc51f 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -2133,9 +2133,9 @@ class Contrat extends CommonObject
if (empty($notooltip) && $user->hasRight('contrat', 'lire')) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowContract");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}
$linkstart = '';
$linkend = '';
diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php
index 0edc34a55a3..49199c22397 100644
--- a/htdocs/core/class/fiscalyear.class.php
+++ b/htdocs/core/class/fiscalyear.class.php
@@ -355,9 +355,9 @@ class Fiscalyear extends CommonObject
if (empty($notooltip) && $user->hasRight('accounting', 'fiscalyear', 'write')) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("FiscalPeriod");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}
diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php
index d0736d63a9c..8619d3c182e 100644
--- a/htdocs/core/class/timespent.class.php
+++ b/htdocs/core/class/timespent.class.php
@@ -757,9 +757,9 @@ class TimeSpent extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowTimeSpent");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index e6ad6bab5c4..64d1f2137fa 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2010,6 +2010,7 @@ function dolPrintText($s)
/**
* Return a string (that can be on several lines) ready to be output on a HTML page.
* To output a text inside an attribute, you can use dolPrintHTMLForAttribute() or dolPrintHTMLForTextArea() inside a textarea
+ * With dolPrintHTML(), only content not already in HTML is encoded with HTML.
*
* @param string $s String to print
* @param int $allowiframe Allow iframe tags
@@ -2023,6 +2024,7 @@ function dolPrintHTML($s, $allowiframe = 0)
/**
* Return a string ready to be output on an HTML attribute (alt, title, data-html, ...)
+ * With dolPrintHTMLForAttribute(), the content is HTML encode, even if it is already HTML content.
*
* @param string $s String to print
* @return string String ready for HTML output
@@ -2032,7 +2034,7 @@ function dolPrintHTMLForAttribute($s)
{
// The dol_htmlentitiesbr will convert simple text into html
// The dol_escape_htmltag will escape html chars.
- return dol_escape_htmltag(dol_string_onlythesehtmltags(dol_htmlentitiesbr($s), 1, 0, 0, 0, array('br', 'b', 'font', 'span')), 1, -1, '', 0, 1);
+ return dol_escape_htmltag(dol_string_onlythesehtmltags(dol_htmlentitiesbr($s), 1, 0, 0, 0, array('br', 'b', 'font', 'hr', 'span')), 1, -1, '', 0, 1);
}
/**
@@ -2071,7 +2073,7 @@ function dolPrintPassword($s)
* @param string $stringtoescape String to escape
* @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
\n";
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 20f33e445da..0c2800dc914 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -1483,9 +1483,9 @@ class Project extends CommonObject
if (empty($notooltip) && $user->hasRight('projet', 'lire')) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowProject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 84ed0911d12..e0ebe42127e 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -1030,9 +1030,9 @@ class Task extends CommonObjectLine
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowTask");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.' nowraponall"';
} else {
$linkclose .= ' class="nowraponall"';
diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php
index 026743f28dd..ee230ff84f1 100644
--- a/htdocs/reception/class/reception.class.php
+++ b/htdocs/reception/class/reception.class.php
@@ -1352,9 +1352,9 @@ class Reception extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("Reception");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip"';
}
diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php
index d2bf9e12306..cdf35793f84 100644
--- a/htdocs/recruitment/admin/setup.php
+++ b/htdocs/recruitment/admin/setup.php
@@ -491,7 +491,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$newname = preg_replace('/_'.preg_quote(strtolower($myTmpObjectKey), '/').'/', '', $name);
print ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php
index 2695b32e7b6..b113a9a5b32 100644
--- a/htdocs/recruitment/admin/setup_candidatures.php
+++ b/htdocs/recruitment/admin/setup_candidatures.php
@@ -484,7 +484,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print ''.img_object($langs->trans("Preview"), 'generic').'';
} else {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php
index ed7aa6f3934..75b3dfe0819 100644
--- a/htdocs/recruitment/class/recruitmentcandidature.class.php
+++ b/htdocs/recruitment/class/recruitmentcandidature.class.php
@@ -799,9 +799,9 @@ class RecruitmentCandidature extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowRecruitmentCandidature");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php
index bb64a3ccb34..3eaa3619e33 100644
--- a/htdocs/recruitment/class/recruitmentjobposition.class.php
+++ b/htdocs/recruitment/class/recruitmentjobposition.class.php
@@ -858,9 +858,9 @@ class RecruitmentJobPosition extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowRecruitmentJobPosition");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index 75a96e391f6..04bb088238c 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -957,9 +957,9 @@ class Dolresource extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php
index be9411ac5aa..32205e8e4e2 100644
--- a/htdocs/salaries/class/paymentsalary.class.php
+++ b/htdocs/salaries/class/paymentsalary.class.php
@@ -902,9 +902,9 @@ class PaymentSalary extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("SalaryPayment");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php
index e0d3abf655c..3d4ff5fba8b 100644
--- a/htdocs/salaries/class/salary.class.php
+++ b/htdocs/salaries/class/salary.class.php
@@ -614,9 +614,9 @@ class Salary extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php
index 8d2af81cabb..29b48fb1e7b 100644
--- a/htdocs/societe/admin/societe.php
+++ b/htdocs/societe/admin/societe.php
@@ -667,7 +667,7 @@ foreach ($dirsociete as $dirroot) {
if ($module->type == 'pdf') {
$linkspec = ''.img_object($langs->trans("Preview"), 'pdf').'';
} else {
- $linkspec = img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ $linkspec = img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print $linkspec;
print '';
diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php
index 7bdebe75464..af4f766b89e 100644
--- a/htdocs/societe/class/companypaymentmode.class.php
+++ b/htdocs/societe/class/companypaymentmode.class.php
@@ -499,9 +499,9 @@ class CompanyPaymentMode extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowCompanyPaymentMode");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index b449c4a1c26..312a41842fb 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -3115,9 +3115,9 @@ class Societe extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowCompany");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').' refurl valignmiddle"';
$target_value = array('_self', '_blank', '_parent', '_top');
if (in_array($target, $target_value)) {
diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php
index 4dfac945de9..9514a76dc42 100644
--- a/htdocs/societe/class/societeaccount.class.php
+++ b/htdocs/societe/class/societeaccount.class.php
@@ -514,9 +514,9 @@ class SocieteAccount extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("WebsiteAccount");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index fd29fe5bbbf..ba6dbc98da9 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -2600,9 +2600,9 @@ class SupplierProposal extends CommonObject
if (empty($notooltip) && $user->hasRight('propal', 'lire')) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowSupplierProposal");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}
diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php
index 220f13a01f7..29e65b4021b 100644
--- a/htdocs/ticket/class/cticketcategory.class.php
+++ b/htdocs/ticket/class/cticketcategory.class.php
@@ -499,9 +499,9 @@ class CTicketCategory extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index e0da84aa3d9..f09feeefee1 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -1651,9 +1651,9 @@ class Ticket extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowTicket");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 393282ac161..7c6ad95a238 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -2126,12 +2126,12 @@ if ($action == 'create' || $action == 'adduserldap') {
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'#', '', false, $params);
} else {
unset($params['attr']['title']);
- print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken(), '', true, $params);
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken(), '', true, $params);
}
} elseif ($permissiontoeditpasswordandsee && !$object->ldap_sid &&
(!isModEnabled('multicompany') || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) {
unset($params['attr']['title']);
- print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit', '', true, $params);
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit', '', true, $params);
}
// If we have a password generator engine enabled
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 9c2f051e51c..caff78932cb 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -3170,9 +3170,9 @@ class User extends CommonObject
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$langs->load("users");
$label = $langs->trans("ShowUser");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams . ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index f885c05951d..36251b2bed8 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -875,7 +875,7 @@ class UserGroup extends CommonObject
$label = $langs->trans("ShowGroup");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1, 1).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
}
diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php
index a7a4188a4ad..e11fd3f4700 100644
--- a/htdocs/webhook/class/target.class.php
+++ b/htdocs/webhook/class/target.class.php
@@ -767,9 +767,9 @@ class Target extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowTarget");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php
index 3ac30c92e90..a85d37257f0 100644
--- a/htdocs/website/class/websitepage.class.php
+++ b/htdocs/website/class/websitepage.class.php
@@ -887,9 +887,9 @@ class WebsitePage extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php
index 5df09475419..03ce7d506f5 100644
--- a/htdocs/workstation/class/workstation.class.php
+++ b/htdocs/workstation/class/workstation.class.php
@@ -661,9 +661,9 @@ class Workstation extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowWorkstation");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dolPrintHtmlForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php
index 2003fc808e7..5c5cf97b42f 100644
--- a/htdocs/zapier/class/hook.class.php
+++ b/htdocs/zapier/class/hook.class.php
@@ -494,9 +494,9 @@ class Hook extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' alt="'.dolPrintHtmlForAttribute($label).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' title="'.dolPrintHtmlForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php
index 4991e1d16bd..21f12c38c75 100644
--- a/test/phpunit/SecurityTest.php
+++ b/test/phpunit/SecurityTest.php
@@ -760,13 +760,14 @@ class SecurityTest extends CommonClassTest
$this->assertStringContainsString('Bad string syntax to evaluate', json_encode($result), 'Test 23 - The string was not detected as evil - Can\'t find the string Bad string syntax when i should');
}
+
/**
- * testDolPrintHTML.
+ * testDolPrintHTMLAndDolPrintHtmlForAttribute.
* This method include calls to dol_htmlwithnojs()
*
* @return int
*/
- public function testDolPrintHTML()
+ public function testDolPrintHTMLAndDolPrintHtmlForAttribute()
{
global $conf;
@@ -781,17 +782,62 @@ class SecurityTest extends CommonClassTest
$conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0; // disabled, does not work on HTML5 and some libxml versions
- // For a string that is already HTML (contains HTML tags) with special tags but badly formatted
- $stringtotest = "">";
- $stringfixed = "">";
+ // dolPrintHTML - With dolPrintHTML(), only content not already in HTML is encoded with HTML.
+
+ $stringtotest = "< > bold";
+ $stringfixed = "< > bold";
//$result = dol_htmlentitiesbr($stringtotest);
//$result = dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0);
//$result = dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0));
- //$result = dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0)), 1, 1, 'common', 0, 1);
+ //$result = dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0, array())), 1, 1, 'common', 0, 1);
$result = dolPrintHTML($stringtotest);
print __METHOD__." result=".$result."\n";
- $this->assertEquals($stringfixed, $result, 'Error'); // Expected '' because should failed because login 'auto' does not exists
+ $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTML test 1'); // Expected '' because should failed because login 'auto' does not exists
+ // For a string that is already HTML (contains HTML tags) with special tags but badly formatted
+ $stringtotest = "" > < bold";
+ $stringfixed = "" > < bold";
+ //$result = dol_htmlentitiesbr($stringtotest);
+ //$result = dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0);
+ //$result = dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0));
+ //$result = dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0, array())), 1, 1, 'common', 0, 1);
+ $result = dolPrintHTML($stringtotest);
+ print __METHOD__." result=".$result."\n";
+ $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTML test 2'); // Expected '' because should failed because login 'auto' does not exists
+
+
+ // dolPrintHTMLForAttribute - With dolPrintHTMLForAttribute(), the content is HTML encode, even if it is already HTML content.
+
+ $stringtotest = "< > bold";
+ $stringfixed = "< > <b>bold</b>";
+ //$result = dol_htmlentitiesbr($stringtotest);
+ //$result = dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0);
+ //$result = dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0));
+ //$result = dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0, array())), 1, 1, 'common', 0, 1);
+ $result = dolPrintHTMLForAttribute($stringtotest);
+ print __METHOD__." result=".$result."\n";
+ $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTMLForAttribute test 1'); // Expected '' because should failed because login 'auto' does not exists
+
+ // For a string that is already HTML (contains HTML tags) with special tags but badly formatted
+ $stringtotest = "" > < bold";
+ $stringfixed = "" > < <b>bold</b>";
+ //$result = dol_htmlentitiesbr($stringtotest);
+ //$result = dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0);
+ //$result = dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0));
+ //$result = dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($stringtotest), 1, 1, 1, 0, array())), 1, 1, 'common', 0, 1);
+ $result = dolPrintHTMLForAttribute($stringtotest);
+ print __METHOD__." result=".$result."\n";
+ $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTMLForAttribute test 2'); // Expected '' because should failed because login 'auto' does not exists
+
+
+ // dolPrintHTML
+
+ /*
+ //return dol_escape_htmltag(dol_string_onlythesehtmltags(dol_htmlentitiesbr($s), 1, 0, 0, 0, array('br', 'b', 'font', 'hr', 'span')), 1, -1, '', 0, 1);
+ $result = dolPrintHTMLForAttribute($stringtotest);
+ print __METHOD__." result=".$result."\n";
+ $this->assertEquals($stringfixed, $result, 'Error in dolPrintHTML test 2'); // Expected '' because should failed because login 'auto' does not exists
+ */
// For a string that is already HTML (contains HTML tags) with special tags but badly formatted
$stringtotest = "testA\nhhhh
ddd";
diff --git a/test/phpunit/test.php b/test/phpunit/test.php
new file mode 100755
index 00000000000..cfdfdd55d52
--- /dev/null
+++ b/test/phpunit/test.php
@@ -0,0 +1,46 @@
+#!/usr/bin/env php
+>> dol_escape_htmltag(eée < > bbbold) - should not happen\n";
+print dol_escape_htmltag("eée < > bbbold", 1);
+print "\n";
+print ">>> dol_escape_htmltag(eée < > bbbold)\n";
+print dol_escape_htmltag("eée < > bbbold", 1);
+print "\n";
+print '>>> dol_escape_htmltag(<script>alert("azerty")</script>)'."\n";
+print dol_escape_htmltag('<script>alert("azerty")</script>', 1);
+print "\n";
+
+print "\n";
+
+// dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($s), 1, 1, 1, array())), 1, 1, 'common', 0, 1);
+print ">>> dolPrintHtml(eée < > bbbold) - should not happen\n";
+print dolPrintHtml("eée < > bbbold");
+print "\n";
+print ">>> dolPrintHtml(eée < > bbbold)\n";
+print dolPrintHtml("eée < > bbbold");
+print "\n";
+print '>>> dolPrintHtml(<script>alert("azerty")</script>)'."\n";
+print dolPrintHtml('<script>alert("azerty")</script>');
+print "\n";
+
+print "\n";
+
+// dol_escape_htmltag(dol_string_onlythesehtmltags(dol_htmlentitiesbr($s), 1, 0, 0, 0, array('br', 'b', 'font', 'hr', 'span')), 1, -1, '', 0, 1);
+print ">>> dolPrintHtmlForattribute(eée < > bbbold)\n";
+print dolPrintHtmlForAttribute("eée < > bbbold");
+print "\n";
+print ">>> dolPrintHtmlForAttribute(eée < > bbbold)\n";
+print dolPrintHtmlForAttribute("eée < > bbbold");
+print "\n";
+print '>>> dolPrintHtmlForattribute(<script>alert("azerty")</script>)'."\n";
+print dolPrintHtmlForAttribute('<script>alert("azerty")</script>');
+print "\n";