mirror of
https://github.com/lrsjng/h5ai.git
synced 2024-09-20 04:38:51 -04:00
Fix the Tar creator for cases where filenames aren't absolute
This commit is contained in:
parent
24ae3bed4d
commit
89acf0cafc
1 changed files with 5 additions and 1 deletions
|
@ -86,7 +86,11 @@ class Archive {
|
||||||
foreach (array_values($this->files) as $file) {
|
foreach (array_values($this->files) as $file) {
|
||||||
|
|
||||||
// TAR supports filenames up to 253 chars, but the name should be split ubti a 154-byte prefix and 99-byte name
|
// TAR supports filenames up to 253 chars, but the name should be split ubti a 154-byte prefix and 99-byte name
|
||||||
assert(substr($file, 0, strlen($root_path)) == $root_path);
|
if (substr($file, 0, strlen($root_path)) != $root_path) {
|
||||||
|
$file = $this->app->get_abs_path().'/'.$file;
|
||||||
|
}
|
||||||
|
if (!file_exists($file)) continue;
|
||||||
|
|
||||||
$local_filename = normalize_path(substr($file, strlen($root_path) + 1));
|
$local_filename = normalize_path(substr($file, strlen($root_path) + 1));
|
||||||
$filename_parts = array('', substr($local_filename, -99));
|
$filename_parts = array('', substr($local_filename, -99));
|
||||||
if (strlen($local_filename) > 99) $filename_parts[0] = substr($local_filename, 0, -99);
|
if (strlen($local_filename) > 99) $filename_parts[0] = substr($local_filename, 0, -99);
|
||||||
|
|
Loading…
Reference in a new issue