From 96215ccea51feee84d77a7de5b8020015c22bc09 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Tue, 3 Feb 2015 13:05:28 +0100 Subject: [PATCH] Fix bad operator for and --- htdocs/admin/tools/export.php | 4 ++-- htdocs/core/class/rssparser.class.php | 2 +- htdocs/core/filemanagerdol/connectors/php/commands.php | 2 +- htdocs/core/modules/member/doc/pdf_standard.class.php | 2 +- .../core/modules/printsheet/doc/pdf_standardlabel.class.php | 2 +- htdocs/expedition/card.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 0831571ace1..721692145a1 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -480,10 +480,10 @@ function backup_tables($outputfile, $tables='*') if ($row[$j] == null and !is_string($row[$j])) { // IMPORTANT: if the field is NULL we set it NULL $row[$j] = 'NULL'; - } elseif(is_string($row[$j]) and $row[$j] == '') { + } elseif(is_string($row[$j]) && $row[$j] == '') { // if it's an empty string, we set it as an empty string $row[$j] = "''"; - } elseif(is_numeric($row[$j]) and !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0) + } elseif(is_numeric($row[$j]) && !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0) // if it's a number, we return it as-is // $row[$j] = $row[$j]; } else { // else for all other cases we escape the value and put quotes around diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 5a156b1eda7..349b32d5104 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -550,7 +550,7 @@ class RssParser // elseif ($this->_format == 'atom' and $el == 'link' ) { - if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' ) + if ( isset($attrs['rel']) && $attrs['rel'] == 'alternate' ) { $link_el = 'link'; } diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index 6369ac9d3ae..333717d810d 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -174,7 +174,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') if ( isset( $_FILES['NewFile'] ) && !is_null($_FILES['NewFile']['tmp_name']) // This is for the QuickUpload tab box - or (isset($_FILES['upload']) and !is_null($_FILES['upload']['tmp_name']))) + or (isset($_FILES['upload']) && !is_null($_FILES['upload']['tmp_name']))) { global $Config ; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index cef4155c607..9268a10f3c4 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -137,7 +137,7 @@ class pdf_standard $imgscaleheight=(empty($forceimgscalewidth)?0.5:$forceimgscalewidth); // Scale of image for height (1=Full height of sticker) // We are in a new page, then we must add a page - if (($this->_COUNTX ==0) and ($this->_COUNTY==0) and (!$this->_First==1)) { + if (($this->_COUNTX ==0) && ($this->_COUNTY==0) and (!$this->_First==1)) { $pdf->AddPage(); } $this->_First=0; diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 8ae45bdc681..193de960bb8 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -135,7 +135,7 @@ class pdf_standardlabel $imgscaleheight=(empty($forceimgscalewidth)?0.5:$forceimgscalewidth); // Scale of image for height (1=Full height of sticker) // We are in a new page, then we must add a page - if (($this->_COUNTX ==0) and ($this->_COUNTY==0) and (!$this->_First==1)) { + if (($this->_COUNTX ==0) && ($this->_COUNTY==0) and (!$this->_First==1)) { $pdf->AddPage(); } $this->_First=0; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index f4a270cca00..d9539f17eb4 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -882,7 +882,7 @@ if ($action == 'create') if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0; } - if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_object($product->stock_warehouse[$warehouse_id]))) + if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() && is_object($product->stock_warehouse[$warehouse_id]))) { // Quantity to send print '<td align="center">'; -- GitLab