diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index de999b305bb..8cf0dc801ce 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -2153,11 +2153,10 @@ class FormFile if ($nboflinks > 0) { include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; } - foreach ($links as $link) { print ''; //edit mode - if ($action == 'update' && $selected === $link->id) { + if ($action == 'update' && $selected === (int) $link->id) { print ''; print ''; print ''; diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 34f05db4c11..8ea08e7d52a 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -254,7 +254,7 @@ class Link extends CommonObject if ($num > 0) { while ($obj = $this->db->fetch_object($resql)) { $link = new Link($this->db); - $link->id = $obj->rowid; + $link->id = (int) $obj->rowid; $link->entity = $obj->entity; $link->datea = $this->db->jdate($obj->datea); $link->url = $obj->url;