From 25b1d063ae62b3d0df5b61909551fa599bcbce5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Jun 2018 11:45:10 +0200 Subject: [PATCH] Fix length of hidden password --- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/tpl/extrafields_view.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9d164325fd6..839528ddc20 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1717,7 +1717,7 @@ class ExtraFields } elseif ($type == 'password') { - $value=preg_replace('/./i','*',$value); + $value=dol_trunc(preg_replace('/./i','*',$value), 8, 'right', 'UTF-8', 1); } else { diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 52586490a43..7253474c36b 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -129,7 +129,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] print ''; $html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : ''; - print ''; + print ''; // Convert date into timestamp format if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('date','datetime')))