diff --git a/ChangeLog b/ChangeLog
index 798f3ef91f4..87e7f4ba18b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -151,6 +151,9 @@ Dolibarr better:
no more required, were also removed. Use this new one if you were using one of them.
- The trigger that activate or close a contract line is run on a contract line, not on contract.
+Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
+feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
+
***** ChangeLog for 4.0.3 to 4.0.2 *****
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php
index 74078740080..1df180452c3 100644
--- a/htdocs/core/lib/bank.lib.php
+++ b/htdocs/core/lib/bank.lib.php
@@ -197,9 +197,10 @@ function checkBanForAccount($account)
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
// Multiplication de chaque groupe par les coef du tableau
+var_dump($rib);
for ($i = 0, $s = 0; $i < 3; $i++) {
$code = substr($rib, 7 * $i, 7);
- $s += (0 + $code) * $coef[$i];
+ $s += (0 + (int) $code) * $coef[$i];
}
// Soustraction du modulo 97 de $s a 97 pour obtenir la cle
$cle_rib = 97 - ($s % 97);
diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php
index a0d61144582..cd897071551 100644
--- a/htdocs/core/lib/date.lib.php
+++ b/htdocs/core/lib/date.lib.php
@@ -175,7 +175,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
$sTime='';
$sDay=0;
- $sWeek='';
+ $sWeek=0;
if ($iSecond >= $lengthOfDay)
{
@@ -218,7 +218,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
}
if ($format == 'allhourmin')
{
- return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
+ return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
}
if ($format == 'allhour')
{
diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php
index e94c0c7dcfe..2fe652f6ac9 100644
--- a/htdocs/core/lib/price.lib.php
+++ b/htdocs/core/lib/price.lib.php
@@ -80,6 +80,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
$result=array();
// Clean parameters
+ if (empty($info_bits)) $info_bits=0;
if (empty($txtva)) $txtva=0;
if (empty($seller) || ! is_object($seller))
{
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index c51c99ff1ff..e69fd312f45 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -282,7 +282,7 @@ class Holiday extends CommonObject
$sql = "SELECT";
$sql.= " cp.rowid,";
-
+
$sql.= " cp.fk_user,";
$sql.= " cp.date_create,";
$sql.= " cp.description,";
@@ -869,7 +869,7 @@ class Holiday extends CommonObject
{
$sql = "SELECT value";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
- $sql.= " WHERE name = '".$name."'";
+ $sql.= " WHERE name = '".$this->db->escape($name)."'";
dol_syslog(get_class($this).'::getConfCP name='.$name.' createifnotfound='.$createifnotfound, LOG_DEBUG);
$result = $this->db->query($sql);
@@ -883,7 +883,7 @@ class Holiday extends CommonObject
if ($createifnotfound)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_config(name, value)";
- $sql.= " VALUES('".$name."', '".$createifnotfound."')";
+ $sql.= " VALUES('".$this->db->escape($name)."', '".$this->db->escape($createifnotfound)."')";
$result = $this->db->query($sql);
if ($result)
{
@@ -948,7 +948,7 @@ class Holiday extends CommonObject
$nbUser = count($users);
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
- $sql.= " value = '".$newdateforlastupdate."'";
+ $sql.= " value = '".$this->db->escape($newdateforlastupdate)."'";
$sql.= " WHERE name = 'lastUpdate'";
$result = $this->db->query($sql);
@@ -1635,6 +1635,7 @@ class Holiday extends CommonObject
$this->date_fin=dol_now()+(24*3600);
$this->fk_validator=1;
$this->halfday=0;
+ $this->fk_type=1;
}
}
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index fd3445375a9..9248a07469c 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1909,10 +1909,9 @@ class Societe extends CommonObject
if (! empty($conf->accounting->enabled) && $this->fournisseur)
$label.= '
' . $langs->trans('SupplierAccountancyCode') . ': '. $this->code_compta_fournisseur;
- if (! empty($this->logo))
+ if (! empty($this->logo) && class_exists('Form'))
{
$label.= '