Skip to content

Commit

Permalink
Merge pull request #15974 from eileenmcnaughton/ex_clean
Browse files Browse the repository at this point in the history
Make else statement more legible
  • Loading branch information
seamuslee001 authored Dec 2, 2019
2 parents 3943019 + 3bc1f89 commit 3f0a734
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions CRM/Core/Report/Excel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 3f0a734

Please sign in to comment.