diff options
author | Urban Müller | 2018-11-14 13:24:08 +0100 |
---|---|---|
committer | Urban Müller | 2018-11-14 13:24:08 +0100 |
commit | 03e493d144fb3b4e524f0d5e757d82021d1cbed8 (patch) | |
tree | 15295ee3965304d4ccfe984b82d21323e66ab14c /it.class | |
parent | 6fa985166b3deffe7ce24ceadd551f8eac28a0bd (diff) | |
download | itools-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.class | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |