diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1bdd1cd1d2f..d0f3bb622b2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9248,7 +9248,7 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1) * @param int $showonlyonhover Show the copypaste button only on hover * @return string The string to print for the button */ -function showValueWithCopyAndPasteButton($valuetoprint, $showonlyonhover = 1) +function showValueWithClipboardCPButton($valuetoprint, $showonlyonhover = 1) { $result = ''.$valuetoprint.''; return $result; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 0347efa7411..260800a77f0 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2415,7 +2415,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // Prefix if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''.$langs->trans('Prefix').''.$object->prefix_comm.''; + print ''.$langs->trans('Prefix').''.dol_escape_htmltag($object->prefix_comm).''; print ''; } @@ -2426,7 +2426,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print $langs->trans('CustomerCode'); print ''; print ''; - print showValueWithCopyAndPasteButton($object->code_client); + print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); print ''; $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { @@ -2441,7 +2441,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print $langs->trans('SupplierCode').''; - print $object->code_fournisseur; + print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); $tmpcheck = $object->check_codefournisseur(); if ($tmpcheck != 0 && $tmpcheck != -5) { print ' ('.$langs->trans("WrongSupplierCode").')'; @@ -2454,7 +2454,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) if (!empty($conf->barcode->enabled)) { print ''; - print $langs->trans('Gencod').''.dol_escape_htmltag($object->barcode); + print $langs->trans('Gencod').''.showValueWithClipboardCPButton(dol_escape_htmltag($object->barcode)); print ''; print ''; } @@ -2470,7 +2470,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print ''; print ''.$idprof.''; $key = 'idprof'.$i; - print $object->$key; + print showValueWithClipboardCPButton(dol_escape_htmltag($object->$key)); if ($object->$key) { if ($object->id_prof_check($i, $object) > 0) print '   '.$object->id_prof_url($i, $object);