Bug #80351 [NEW]: Incorrect detection of zip_*_method_supported() availability in libzip

From: Date: Thu, 12 Nov 2020 08:46:52 +0000
Subject: Bug #80351 [NEW]: Incorrect detection of zip_*_method_supported() availability in libzip
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230287@lists.php.net to get a copy of this message
From: nvizovitin at plesk dot com Operating system: Any with older libzip PHP version: 8.0.0RC3 Package: Zip Related Bug Type: Bug Bug description:Incorrect detection of zip_*_method_supported() availability in libzip Description: ------------ HAVE_METHOD_SUPPORTED AC_DEFINE is set incorrectly during zip extension configuration for some libzip versions < 1.7.0, such as 1.3.2. Detection of zip_compression_method_supported() and zip_encryption_method_supported() functions availability in libzip is incorrect. They are publicly available since libzip 1.7.0, however the first one was privately available before (at least in 1.3.2), so its detection via AC_CHECK_LIB was successful where it should not have been. This results in runtime errors which happen on attempts to use ZipArchive::isEncryptionMethodSupported() or phpinfo(). See also: * https://libzip.org/documentation/zip_compression_method_supported.html * https://libzip.org/documentation/zip_encryption_method_supported.html The issue was also reproduced on PHP 8.0.0RC4 (https://downloads.php.net/~carusogabriel/php-8.0.0RC4.tar.xz). We encountered this issue on CentOS 7 with non-system libzip build. Test script: --------------- php -r '$zip = new ZipArchive(); print($zip->isEncryptionMethodSupported(ZipArchive::EM_AES_256));' OR php -r 'phpinfo();' Expected result: ---------------- Provided PHP was built against libzip < 1.7.0: PHP Fatal error: Uncaught Error: Call to undefined method ZipArchive::isEncryptionMethodSupported() in Command line code:1 Stack trace: #0 {main} thrown in Command line code on line 1 AND phpinfo() doesn't result in error Actual result: -------------- /opt/plesk/php/8.0/bin/php: symbol lookup error: /opt/plesk/php/8.0/lib64/php/modules/zip.so: undefined symbol: zip_encryption_method_supported (in both cases) -- Edit bug report at https://bugs.php.net/bug.php?id=80351&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80351&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80351&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80351&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80351&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80351&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80351&r=support Expected behavior: https://bugs.php.net/fix.php?id=80351&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80351&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80351&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80351&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80351&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80351&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80351&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80351&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80351&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80351&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80351&r=mysqlcfg

« previous php.bugs (#230287) next »