From 3bf6bfbf34af19ea61b5572daaf5b3ce76398491 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 15 Mar 2024 02:30:20 +0100 Subject: [PATCH 1/2] Fix ContactTest::testContactUpdate # ContactTest::testContactUpdate Fix bug introduced in b2cbf7fe3c5..3fb6501beaa --- htdocs/contact/class/contact.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a12bb616949..7ba67557e6b 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -604,7 +604,7 @@ class Contact extends CommonObject $this->fax = trim($this->fax); $this->zip = (empty($this->zip) ? '' : trim($this->zip)); $this->town = (empty($this->town) ? '' : trim($this->town)); - $this->country_id = ($this->country_id > 0 ? 0 : $this->country_id); + $this->country_id = empty($this->country_id) || $this->country_id < 0 ? 0 : $this->country_id; if (empty($this->statut)) { $this->statut = 0; } From 105a0831fa4ceb49913af4e60c275cd20125c86a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Mar 2024 08:40:35 +0100 Subject: [PATCH 2/2] Update contact.class.php --- htdocs/contact/class/contact.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 7ba67557e6b..d6c3387d89e 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -604,7 +604,7 @@ class Contact extends CommonObject $this->fax = trim($this->fax); $this->zip = (empty($this->zip) ? '' : trim($this->zip)); $this->town = (empty($this->town) ? '' : trim($this->town)); - $this->country_id = empty($this->country_id) || $this->country_id < 0 ? 0 : $this->country_id; + $this->country_id = (empty($this->country_id) || $this->country_id < 0) ? 0 : $this->country_id; if (empty($this->statut)) { $this->statut = 0; }