summaryrefslogtreecommitdiff
path: root/inc/io.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-07-24 15:18:19 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-07-24 15:18:19 +0200
commit2ad45addfac44b12c095303cf7abe488576b0802 (patch)
treeb28d5d591e1db491c52480f786e10bb9ed88366f /inc/io.php
parent4a690352a4dc4dff668c4189c41d982f838bc8b9 (diff)
downloadrpg-2ad45addfac44b12c095303cf7abe488576b0802.tar.gz
rpg-2ad45addfac44b12c095303cf7abe488576b0802.tar.bz2
avoid errors on trying to read corrupt gzip files
Diffstat (limited to 'inc/io.php')
-rw-r--r--inc/io.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/inc/io.php b/inc/io.php
index 9be648824..704c5b1a6 100644
--- a/inc/io.php
+++ b/inc/io.php
@@ -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{