From 2cdea7e37cc67b13c3072b512070bb2f8f428bc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Sep 2017 19:05:13 +0200 Subject: [PATCH] Fix bug reported by scrutinizer --- htdocs/accountancy/class/accountancycategory.class.php | 2 +- htdocs/categories/class/categorie.class.php | 6 ++++-- htdocs/core/class/html.formwebsite.class.php | 6 ++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 2715337c7fc..3e661958931 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -354,7 +354,7 @@ class AccountancyCategory } if ($thirdparty_code != 'nofilter') { - $sql .= " AND thirdparty_code = '".$ths->db->escape($thirdparty_code)."'"; + $sql .= " AND thirdparty_code = '".$this->db->escape($thirdparty_code)."'"; } dol_syslog(__METHOD__ . " sql=" . $sql, LOG_DEBUG); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 12804a5fab9..7a1a3985dd9 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1549,8 +1549,10 @@ class Categorie extends CommonObject } if (file_exists($dir)) { - if (is_array($file['name']) && count($file['name']) > 0) { - for($i = 0; $i <= count($file['name']); $i ++) { + if (is_array($file['name']) && count($file['name']) > 0) + { + $nbfile = count($file['name']); + for ($i = 0; $i <= $nbfile; $i ++) { $originImage = $dir . $file['name'][$i]; diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index 666311d1744..a42bdd0158a 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -510,8 +510,6 @@ class FormWebsite { if ($lines[$i]->fk_parent == $parent) { - $var = !$var; - //var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); // $lines[$i]->id may be empty if project has no lines // Break on a new project @@ -1119,7 +1117,7 @@ class FormWebsite $emptybox=new ModeleBoxes($db); - $boxlista.="\n\n"; + $boxlista ="\n\n"; $boxlista.='
'."\n"; // Define $box_max_lines @@ -1152,7 +1150,7 @@ class FormWebsite $boxlista.= "
\n"; $boxlista.= "\n"; - $boxlistb.= "\n\n"; + $boxlistb = "\n\n"; $boxlistb.= '