Fix #80648: Fix for bug 79296 should be based on runtime version#6625
Fix #80648: Fix for bug 79296 should be based on runtime version#6625cmb69 wants to merge 2 commits intophp:PHP-7.4from
Conversation
|
@cmb69 Thanks for the quick patch!
Just to clarify, the fallback is not removed as of PHP 8.0.0. It is just deprecated and not dependent on the libzip version anymore. The latter is probably because PHP 8.0.0 can only be used with newer versions of libzip, so that the >= 1.6.0 version constraint is necessarily true. |
|
Simpler way is to drop version check (as in PHP 8, without the warning). In short, before 1.6.0 ZIP_TRUNCATE is implicit for empty file, so always adding it is not a problem P.S. so have to add the #ifdef ZIP_RDONLY which only exists in v1+ and 0.11 is still supported |
|
@aboks also notice that code pasted in referenced issue is wrong... will raise a warnign with PHP 8 and will fail in the future ;) Should be (as tempnam create an empty file, which is NOT a valid archive) |
Makes sense to me. |
This should go into PHP-7.4 only, since that fallback is removed as of PHP 8.0.0 altogether.
@remicollet, what do you think?