From 617517b1426c57b9505b65ea532e5fea9fc5a708 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 22 Mar 2010 19:33:34 +0000 Subject: handle empty files --- it.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'it.class') diff --git a/it.class b/it.class index 2fc4b35..ab4d87b 100644 --- a/it.class +++ b/it.class @@ -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; -- cgit v1.2.3