mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-29 06:25:18 -04:00
php_tar: fixing emtpy files bug.
This commit is contained in:
parent
74f1c0a986
commit
c5f23c5289
1 changed files with 3 additions and 7 deletions
|
@ -79,16 +79,12 @@ class Archive {
|
||||||
}
|
}
|
||||||
foreach ($files as $real_file => $archived_file) {
|
foreach ($files as $real_file => $archived_file) {
|
||||||
|
|
||||||
if ($filesizes[$real_file] === 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $this->php_tar_fileheader($real_file, $archived_file);
|
echo $this->php_tar_fileheader($real_file, $archived_file);
|
||||||
$this->print_file($real_file);
|
$this->print_file($real_file);
|
||||||
|
|
||||||
$pad_file = 512 - ($filesizes[$real_file] % 512);
|
$size = $filesizes[$real_file];
|
||||||
if ($pad_file) {
|
if ($size % 512 != 0) {
|
||||||
echo str_repeat("\0", $pad_file);
|
echo str_repeat("\0", 512 - ($size % 512));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue