Topic: Bug 5326 needs reversion for PHP < 5.5

The recent commit by @itronics addressing modules installation PHP function unpack() using "Z" instead of existing "a" prefix is valid only for PHP 5.5 and above as per the manual:

https://www.php.net/manual/en/function.unpack.php

This commit will break all installs using any PHP < v5.5.

In fact, only an empty folder is created in the modules/_cache folder when an install is attempted.

Hence it is advised to make a check for PHP version before such a choice is made.

@joe, @Janusz - kindly do the needful.

Post's attachments

Cannot_Install_Lang_After_a_toZ_unpack_commit_2021-01-31.png 9.8 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Bug 5326 needs reversion for PHP < 5.5

Fixed and committed in my fixes repo by replacing line 325 in includes/archive.inc:

                $temp = unpack("Z100name/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Z1type/Z100symlink/Z6magic/Z2temp/Z32temp/Z32temp/Z8temp/Z8temp/Z155prefix/Z12temp", $block);

with

                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);

Re: Bug 5326 needs reversion for PHP < 5.5

Thanksn@apmuthu

I will fix this asap.

Joe

Re: Bug 5326 needs reversion for PHP < 5.5

Committed to stable repo.

/Joe