From 99a45216ecec35e631f232c6bfc36fdcd7222ffe Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Fri, 9 May 2008 01:59:41 +0000 Subject: allow save when only one textfile in path --- it_text.class | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/it_text.class b/it_text.class index 3d48d96..c920941 100644 --- a/it_text.class +++ b/it_text.class @@ -52,7 +52,7 @@ function it_text($p = array()) foreach ((array)$p['phpfile'] as $phpfile) { $oldtext = $this->statictext; - if (is_array($ret = @include($phpfile))) + if (is_array($ret = include($phpfile))) $this->statictext += $ret; else $this->statictext = $oldtext + $this->statictext; # FIXME: compatibility mode @@ -238,7 +238,8 @@ function dump_php() $this->statictext = array_merge(array('_' => $text['_']), $text); $oldmask = umask(002); - if ($f = fopen($this->p['phpfile'], 'w')) + $phpfiles = (array)$this->p['phpfile']; + if ($f = fopen(count($phpfiles) == 1 ? $phpfiles[0] : null, 'w')) { $result = (fputs($f, 'statictext, true), array("=> \n array (" => "=> array(", "array (\n '_'" => "array(\n'_'", "\n ),\n " => "\n),\n", "\n ),\n" => "\n),\n", "\r" => "")) . ";\n?>\n") !== false); fclose($f); -- cgit v1.2.3