diff options
author | Urban Müller | 2010-03-22 19:33:34 +0000 |
---|---|---|
committer | Urban Müller | 2010-03-22 19:33:34 +0000 |
commit | 617517b1426c57b9505b65ea532e5fea9fc5a708 (patch) | |
tree | 699d058d453bfb9bcdc3cf8e513b979f90fabdff /it.class | |
parent | 66b36021e6ffd62450c446682688aff4ff0d19d1 (diff) | |
download | itools-617517b1426c57b9505b65ea532e5fea9fc5a708.tar.gz itools-617517b1426c57b9505b65ea532e5fea9fc5a708.tar.bz2 itools-617517b1426c57b9505b65ea532e5fea9fc5a708.zip |
handle empty files
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -747,7 +747,7 @@ static function mail($p) static function file_get($filename, $p = array()) { $data = file_get_contents($filename == "-" ? "php://stdin" : $filename); - if ($p['keyval']) + if ($p['keyval'] && $data !== false) { foreach (explode("\n", rtrim($data, "\n")) as $line) { @@ -756,7 +756,7 @@ static function file_get($filename, $p = array()) } } else if ($p['lines']) - $result = explode("\n", rtrim($data, "\n")); + $result = $data !== false ? explode("\n", rtrim($data, "\n")) : array(); else $result = $data; |