Skip to content

Commit

Permalink
Z has been added with PHP 5.5, but is only different from a while unp…
Browse files Browse the repository at this point in the history
…acking anyway.
  • Loading branch information
yunosh committed Apr 27, 2017
1 parent b5b7d44 commit 344178c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions framework/Compress/lib/Horde/Compress/Tar.php
Expand Up @@ -121,21 +121,21 @@ public function compress($data, $params = array())

/* Header data for the file entries. */
$header =
pack('Z99', $name) . "\0" . /* Name. */
pack('a99', $name) . "\0" . /* Name. */
$this->_formatNumber($file, 'getPerms') . /* Permissions. */
$this->_formatNumber($file, 'getOwner') . /* Owner ID. */
$this->_formatNumber($file, 'getGroup') . /* Group ID. */
sprintf("%011o\0", $isLink ? 0 : $length) . /* Size. */
sprintf("%011o\0", $ftime) . /* MTime. */
' ' . /* Checksum. */
($isLink ? '1' : '0') . /* Type. */
pack('Z99', $link) . "\0" . /* Link target. */
pack('a99', $link) . "\0" . /* Link target. */
"ustar\0" . "00" . /* Magic marker. */
pack('Z31', $owner) . "\0" . /* Owner name. */
pack('Z31', $group) . "\0" . /* Group name. */
pack('Z16', '') . /* Device numbers. */
pack('Z154', $prefix) . "\0"; /* Name prefix. */
$header = pack('Z512', $header);
pack('a31', $owner) . "\0" . /* Owner name. */
pack('a31', $group) . "\0" . /* Group name. */
pack('a16', '') . /* Device numbers. */
pack('a154', $prefix) . "\0"; /* Name prefix. */
$header = pack('a512', $header);
$checksum = array_sum(array_map('ord', str_split($header)));
$header = substr($header, 0, 148)
. sprintf("%06o\0 ", $checksum)
Expand Down Expand Up @@ -204,7 +204,7 @@ protected function _formatNumber($file, $method)
if (isset($file['spl'])) {
return sprintf("%07o\0", $file['spl']->$method());
}
return pack('Z8', '');
return pack('a8', '');
}

/**
Expand Down

0 comments on commit 344178c

Please sign in to comment.