Skip to content

Commit

Permalink
Update societe.class.php
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
areaeuro committed May 18, 2018
1 parent e503aeb commit 11714b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/societe/class/societe.class.php
Expand Up @@ -2939,7 +2939,7 @@ function id_prof_check($idprof,$soc)
//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
Expand Down

0 comments on commit 11714b9

Please sign in to comment.