Skip to content
  • Eloy Lafuente (stronk7)'s avatar
    70ae7567
    MDL-51863 packer: ensure empty zip files behavior remains consistent · 70ae7567
    Eloy Lafuente (stronk7) authored
    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.
    70ae7567
    MDL-51863 packer: ensure empty zip files behavior remains consistent
    Eloy Lafuente (stronk7) authored
    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.
Loading