Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug #19746 - fix for changed pack() behavior in PHP 5.5

  • Loading branch information...
commit de7aade3fbd69f365969c0f34a89d177f94c451a 1 parent f536af7
@mrook mrook authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 Archive/Tar.php
View
16 Archive/Tar.php
@@ -1356,11 +1356,17 @@ function _readHeader($v_binary_data, &$v_header)
for ($i=156; $i<512; $i++)
$v_checksum+=ord(substr($v_binary_data,$i,1));
- $v_data = unpack("a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/" .
- "a8checksum/a1typeflag/a100link/a6magic/a2version/" .
- "a32uname/a32gname/a8devmajor/a8devminor/a131prefix",
- $v_binary_data);
-
+ if (version_compare(PHP_VERSION,"5.5.0-dev")<0) {
+ $fmt = "a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/" .
+ "a8checksum/a1typeflag/a100link/a6magic/a2version/" .
+ "a32uname/a32gname/a8devmajor/a8devminor/a131prefix";
+ } else {
+ $fmt = "Z100filename/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/" .
+ "Z8checksum/Z1typeflag/Z100link/Z6magic/Z2version/" .
+ "Z32uname/Z32gname/Z8devmajor/Z8devminor/Z131prefix";
+ }
+ $v_data = unpack($fmt, $v_binary_data);
+
if (strlen($v_data["prefix"]) > 0) {
$v_data["filename"] = "$v_data[prefix]/$v_data[filename]";
}

2 comments on commit de7aade

@renan

Could you release this or are there more bugs with PHP 5.5?

@mrook
Owner

Archive_Tar 1.3.11 was just released!

Please sign in to comment.
Something went wrong with that request. Please try again.