readded missing return statement in parse-function

This commit is contained in:
Susann Sgorzaly
2018-02-23 10:14:01 +01:00
parent 343c683077
commit 249e5a24ac

View File

@@ -394,11 +394,11 @@ class Csv {
* @return bool True on success * @return bool True on success
*/ */
public function parse($input = NULL, $offset = NULL, $limit = NULL, $conditions = NULL) { public function parse($input = NULL, $offset = NULL, $limit = NULL, $conditions = NULL) {
if (!is_null($input)) { if (is_null($input)) {
$this->file = $input; $input = $this->file;
} }
if (empty($this->file)) { if (empty($input)) {
// todo: but why true? // todo: but why true?
return true; return true;
} }
@@ -406,11 +406,12 @@ class Csv {
$this->init($offset, $limit, $conditions); $this->init($offset, $limit, $conditions);
if (strlen($this->file) <= PHP_MAXPATHLEN && is_readable($this->file)) { if (strlen($input) <= PHP_MAXPATHLEN && is_readable($input)) {
$this->data = $this->parse_file($this->file); $this->file = $input;
$this->data = $this->parse_file($input);
} }
else { else {
$this->file_data = &$this->file; $this->file_data = &$input;
$this->data = $this->parse_string(); $this->data = $this->parse_string();
} }
@@ -418,6 +419,8 @@ class Csv {
return false; return false;
} }
return true;
} }
/** /**