mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 20:53:53 +01:00
70ae75674d
With PHP bug #70322 fixed, ZipArchive::close() did start returning false and throwing PHP Warnings with recent PHP versions (5.6.14 and up). Previously (5.6.13 verified) it was returning true, and false in older versions (5.4.x verified). This change does silent the 2 "hacky" calls to close() that we perform in core leaving the 3rd one (used for files having files) unmodified. A new unit test has been created to cover the close() behavior, ideally supporting both old and new PHP versions without harcoding any PHP version. Note that we don't use to rely much on results coming from close(), and that's a good thing given the buggy behavior commented above. This just keeps empty zips working like they were before.