Skip to content

Commit

Permalink
allow zero as key
Browse files Browse the repository at this point in the history
  • Loading branch information
i-just committed Nov 22, 2023
1 parent 3e9bf3a commit 393a57c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/datatypes/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getFeed($url, $settings, $usePrimaryElement = true)
$col = 1;
foreach ($row as $key => $value) {
$newKey = preg_replace('#\r\n?#', " ", $key);
if (empty(trim($newKey))) {
if (trim($newKey) == '') {
$newKey = 'blank_heading_' . $col;
}
$filteredRow[$newKey] = $value;
Expand Down
2 changes: 1 addition & 1 deletion src/datatypes/GoogleSheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getFeed($url, $settings, $usePrimaryElement = true)
foreach ($row as $j => $column) {
$key = $headers[$j];

if (empty(trim($key))) {
if (trim($key) == '') {
$key = 'blank_heading_' . ($j+1);
}

Expand Down

0 comments on commit 393a57c

Please sign in to comment.