From 11714b9b6b42719aa429ffa158ae305d9773d6eb Mon Sep 17 00:00:00 2001 From: areaeuro <30721699+areaeuro@users.noreply.github.com> Date: Fri, 18 May 2018 10:27:54 +0200 Subject: [PATCH] Update societe.class.php Line 2942 throws an error in php 7 "Warning: A non-numeric value encountered" when doing math sum, as substr() may be empty. Convert to intval(substr()) to fix. --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 32f29522268..5766c75b5b8 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2939,7 +2939,7 @@ class Societe extends CommonObject //algorithm checking type code CIF $sum = $num[2] + $num[4] + $num[6]; for ($i = 1; $i < 8; $i += 2) - $sum += substr((2 * $num[$i]),0,1) + substr((2 * $num[$i]),1,1); + $sum += intval(substr((2 * $num[$i]),0,1)) + intval(substr((2 * $num[$i]),1,1)); $n = 10 - substr($sum, strlen($sum) - 1, 1); //Chek special NIF