From 3a50d48b13ecef44438b33be15b8fa6491f9899a Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 16 Dec 2008 01:50:30 +0000 Subject: handly empty arrays --- it.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it.class b/it.class index 480f270..2cb625b 100644 --- a/it.class +++ b/it.class @@ -718,7 +718,7 @@ function file_put($filename, $data, $p = array()) if ($p['keyval']) $data = join("", it::map('"$k\t$v\n"', $data)); else if ($p['lines']) - $data = join("", it::map('"$v\n"', $data)); + $data = count((array)$data) ? join("\n", (array)$data) ."\n" : ""; return file_put_contents($filename == "-" ? "php://stdout" : $filename, $data); } -- cgit v1.2.3