diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index ba6007235f3..ad31e42a625 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -6868,7 +6868,7 @@ abstract class CommonObject
$out = '';
} elseif (preg_match('/varchar/', $type)) {
$out = ' 0 ? ' maxlength="'.$size.'"' : '').' value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
- } elseif (in_array($type, array('mail', 'phone', 'url'))) {
+ } elseif (in_array($type, array('mail', 'phone', 'url', 'ip'))) {
$out = '';
} elseif (preg_match('/^text/', $type)) {
if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field
@@ -7498,6 +7498,8 @@ abstract class CommonObject
$value = dol_print_url($value, '_blank', 32, 1);
} elseif ($type == 'phone') {
$value = dol_print_phone($value, '', 0, 0, '', ' ', 'phone');
+ } elseif ($type == 'ip') {
+ $value = dol_print_ip($value, 0);
} elseif ($type == 'price') {
if (!is_null($value) && $value !== '') {
$value = price($value, 0, $langs, 0, 0, -1, $conf->currency);