From: eileen Date: Mon, 25 Nov 2019 03:53:20 +0000 (+1300) Subject: Make else statement more legible X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3bc1f8982371874b657803414f96caafdb77827b;p=civicrm-core.git 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 --- diff --git a/CRM/Core/Report/Excel.php b/CRM/Core/Report/Excel.php index 46c4943a93..127f23e5c4 100644 --- a/CRM/Core/Report/Excel.php +++ b/CRM/Core/Report/Excel.php @@ -64,10 +64,10 @@ class CRM_Core_Report_Excel { $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 @@ class CRM_Core_Report_Excel { $schema_insert .= $enclosed . str_replace($enclosed, $escaped . $enclosed, $value) . $enclosed; } - else { - $schema_insert .= ''; - } if ($colNo < $fields_cnt - 1) { $schema_insert .= $seperator;