From 3bc1f8982371874b657803414f96caafdb77827b Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 25 Nov 2019 16:53:20 +1300 Subject: [PATCH] Make else statement more legible This just condenses the statement since != '' is so broad we know the final else is only when that is true - ergo it's the same as above --- CRM/Core/Report/Excel.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CRM/Core/Report/Excel.php b/CRM/Core/Report/Excel.php index 46c4943a9379..127f23e5c41e 100644 --- a/CRM/Core/Report/Excel.php +++ b/CRM/Core/Report/Excel.php @@ -64,10 +64,10 @@ public static function makeCSVTable($header, $rows, $titleHeader = NULL, $output $colNo = 0; foreach ($row as $j => $value) { - if (!isset($value) || is_null($value)) { + if (!isset($value) || is_null($value) || $value === '') { $schema_insert .= ''; } - elseif ($value == '0' || $value != '') { + else { // loic1 : always enclose fields //$value = ereg_replace("\015(\012)?", "\012", $value); $value = preg_replace("/\015(\012)?/", "\012", $value); @@ -89,9 +89,6 @@ public static function makeCSVTable($header, $rows, $titleHeader = NULL, $output $schema_insert .= $enclosed . str_replace($enclosed, $escaped . $enclosed, $value) . $enclosed; } - else { - $schema_insert .= ''; - } if ($colNo < $fields_cnt - 1) { $schema_insert .= $seperator;