Skip to content
Snippets Groups Projects
Commit 2ad45add authored by Andreas Gohr's avatar Andreas Gohr
Browse files

avoid errors on trying to read corrupt gzip files

parent 4a690352
No related branches found
No related tags found
No related merge requests found
......@@ -107,13 +107,15 @@ function io_readFile($file,$clean=true){
$ret = '';
if(file_exists($file)){
if(substr($file,-3) == '.gz'){
$ret = join('',gzfile($file));
$ret = gzfile($file);
if(is_array($ret)) $ret = join('', $ret);
}else if(substr($file,-4) == '.bz2'){
$ret = bzfile($file);
}else{
$ret = file_get_contents($file);
}
}
if($ret === null) return false;
if($ret !== false && $clean){
return cleanText($ret);
}else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment