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/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/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/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 31bb5a8dd73..077f2446540 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 069b76a9c88..26efa02d0d5 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3898,9 +3898,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 a3e40af94e9..a3e4ef47bef 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 0f83d2dc1f4..ea22c7c335b 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