From 02daf099284897a8020a4712b15dce316057869c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Dec 2020 23:06:34 +0100 Subject: [PATCH] Fix for php8 --- htdocs/core/class/conf.class.php | 4 ++++ htdocs/core/lib/functions.lib.php | 2 +- htdocs/main.inc.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 09f2b0a44ae..a1800e03980 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -52,9 +52,11 @@ class Conf public $disable_compute; //! Used to store current currency (ISO code like 'USD', 'EUR', ...) public $currency; + //! Used to store current css (from theme) public $theme; // Contains current theme ("eldy", "auguria", ...) public $css; // Contains full path of css page ("/theme/eldy/style.css.php", ...) + //! Used to store current menu handler public $standard_menu; // List of activated modules @@ -98,6 +100,8 @@ class Conf public $dol_no_mouse_hover; // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone public $dol_use_jmobile; // Set if we force param dol_use_jmobile into login url + public $liste_limit; + /** * Constructor diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 92114b7c094..dd80c660e71 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4877,7 +4877,7 @@ function price2num($amount, $rounding = '', $option = 0) elseif ($rounding == 'CR') $nbofdectoround = 8; elseif (is_numeric($rounding)) $nbofdectoround = $rounding; //print "RR".$amount.' - '.$nbofdectoround.'
'; - if (dol_strlen($nbofdectoround)) $amount = round($amount, $nbofdectoround); // $nbofdectoround can be 0. + if (dol_strlen($nbofdectoround)) $amount = round(is_string($amount) ? (float) $amount : $amount, $nbofdectoround); // $nbofdectoround can be 0. else return 'ErrorBadParameterProvidedToFunction'; //print 'SS'.$amount.' - '.$nbofdec.' - '.$dec.' - '.$thousand.' - '.$nbofdectoround.'
'; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 14944619d6e..01e51e5e96f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2802,7 +2802,7 @@ if (!function_exists("llxFooter")) if (!empty($contextpage)) $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring] = $contextpage; if (!empty($page) && $page > 0) $_SESSION['lastsearch_page_tmp_'.$relativepathstring] = $page; - if (!empty($limit) && $limit != $conf->limit) $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] = $limit; + if (!empty($limit) && $limit != $conf->liste_limit) $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] = $limit; unset($_SESSION['lastsearch_contextpage_'.$relativepathstring]); unset($_SESSION['lastsearch_page_'.$relativepathstring]);