Fixed parse()'s return value: return true only if $data is useful

This commit is contained in:
Fonata
2018-03-17 12:01:45 +01:00
parent 10895788c8
commit c8d15557cb

View File

@@ -369,13 +369,11 @@ class Csv {
}
if (empty($input)) {
// todo: but why true?
return true;
return false;
}
$this->init($offset, $limit, $conditions);
if (strlen($input) <= PHP_MAXPATHLEN && is_readable($input)) {
$this->file = $input;
$this->data = $this->parse_file();
@@ -385,12 +383,7 @@ class Csv {
$this->data = $this->parse_string();
}
if ($this->data === false) {
return false;
}
return true;
return $this->data !== false;
}
/**