Bug 5326 needs reversion for PHP < 5.5. Fixed.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 31 Jan 2021 15:11:10 +0000 (16:11 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 31 Jan 2021 15:11:10 +0000 (16:11 +0100)
includes/archive.inc

index b99b15dbca51e295c5250b1e8dd8c5d229061727..1b9e11efe4735753b7c1d8979e77a4b446f921ae 100644 (file)
@@ -322,8 +322,10 @@ class tar_file extends archive
 
                        while ($block = fread($fp, 512))
                        {
-                               $temp = unpack("Z100name/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Z1type/Z100symlink/Z6magic/Z2temp/Z32temp/Z32temp/Z8temp/Z8temp/Z155prefix/Z12temp", $block);
-
+                               if (version_compare(PHP_VERSION, '5.5.0') >= 0)
+                                       $temp = unpack("Z100name/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Z1type/Z100symlink/Z6magic/Z2temp/Z32temp/Z32temp/Z8temp/Z8temp/Z155prefix/Z12temp", $block);
+                               else
+                    $temp = unpack("a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp", $block);                                      
                                $file = array (
                                        'name' => rtrim($temp['prefix']) . rtrim($temp['name']),
                                        'stat' => array (