summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2018-11-14 13:24:08 +0100
committerUrban Müller2018-11-14 13:24:08 +0100
commit03e493d144fb3b4e524f0d5e757d82021d1cbed8 (patch)
tree15295ee3965304d4ccfe984b82d21323e66ab14c /it.class
parent6fa985166b3deffe7ce24ceadd551f8eac28a0bd (diff)
downloaditools-03e493d144fb3b4e524f0d5e757d82021d1cbed8.tar.gz
itools-03e493d144fb3b4e524f0d5e757d82021d1cbed8.tar.bz2
itools-03e493d144fb3b4e524f0d5e757d82021d1cbed8.zip
do not silently ::fatal when trying to open $args[0] with ../ as filename (which it is not always)
Diffstat (limited to 'it.class')
-rw-r--r--it.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it.class b/it.class
index 4f6514a..baaf91c 100644
--- a/it.class
+++ b/it.class
@@ -921,8 +921,8 @@ static function _stdin_next()
{
if ($result = $GLOBALS['it_stdin']['args'])
{
- $GLOBALS['it_stdin']['filename'] = array_shift($GLOBALS['it_stdin']['args']);
- $GLOBALS['it_stdin']['fd'] = ($GLOBALS['it_stdin']['filename'] == "-") ? STDIN : @it::fopen($GLOBALS['it_stdin']['filename'], "r");
+ $GLOBALS['it_stdin']['filename'] = $filename = array_shift($GLOBALS['it_stdin']['args']);
+ $GLOBALS['it_stdin']['fd'] = $filename == "-" ? STDIN : (file_exists($filename) ? it::fopen($filename, "r") : false);
$GLOBALS['it_stdin']['line'] = 0;
}