diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-09-29 21:45:27 +0200 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-09-29 21:45:27 +0200 |
commit | 59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80 (patch) | |
tree | e87df15c5ca81556fd1925ad56ba404f664c890e /inc/ZipLib.class.php | |
parent | e0c26282a603881e8d2f839d94c28dbbfc57d71b (diff) | |
download | rpg-59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80.tar.gz rpg-59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80.tar.bz2 |
more scrutinizer issue improvements
Diffstat (limited to 'inc/ZipLib.class.php')
-rw-r--r-- | inc/ZipLib.class.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/inc/ZipLib.class.php b/inc/ZipLib.class.php index 918d38579..cec518b05 100644 --- a/inc/ZipLib.class.php +++ b/inc/ZipLib.class.php @@ -24,10 +24,12 @@ class ZipLib { @rewind($zip); @fseek($zip, $centd['offset']); + $ret = array(); for ($i=0; $i<$centd['entries']; $i++) { $header = $this->ReadCentralFileHeaders($zip); $header['index'] = $i; + $info = array(); $info['filename'] = $header['filename']; $info['stored_filename'] = $header['stored_filename']; $info['size'] = $header['size']; @@ -48,6 +50,7 @@ class ZipLib { function Add($files,$compact) { if(!is_array($files[0])) $files=Array($files); + $ret = array(); for($i=0;$files[$i];$i++){ $fn = $files[$i]; if(!in_Array(dirname($fn[0]),$this->dirs)) @@ -189,7 +192,6 @@ class ZipLib { */ function Extract ( $zn, $to, $index = Array(-1) ) { if(!@is_dir($to)) $this->_mkdir($to); - $ok = 0; $zip = @fopen($zn,'rb'); if(!$zip) return(-1); $cdir = $this->ReadCentralDir($zip,$zn); @@ -203,6 +205,7 @@ class ZipLib { return(-1); } + $stat = array(); for ($i=0; $i<$cdir['entries']; $i++) { @fseek($zip, $pos_entry); $header = $this->ReadCentralFileHeaders($zip); @@ -320,6 +323,7 @@ class ZipLib { $data=unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', fread($zip, 18)); + $centd = array(); if ($data['comment_size'] != 0){ $centd['comment'] = fread($zip, $data['comment_size']); } else { @@ -421,7 +425,6 @@ class ZipLib { function ExtractStr($zn, $name) { - $ok = 0; $zip = @fopen($zn,'rb'); if(!$zip) return(null); $cdir = $this->ReadCentralDir($zip,$zn); |