Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for CRC23 checksum gzuncompress() #622

Merged
merged 3 commits into from
Aug 5, 2023
Merged

Commits on Jul 31, 2023

  1. Allow for CRC23 checksum gzuncompress()

    A zlib compressed stream may have a CRC32 checksum instead of Adler-32 which the PHP gzuncompress() function expects. Add a second zlib decompression attempt if the first one fails. See: https://www.php.net/manual/en/function.gzuncompress.php#79042
    Partially resolves smalot#592.
    GreyWyvern committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    25a902e View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2023

  1. Simplify decodeFilterFlateDecode() error-handling

    Instead of setting an error handler to catch the E_WARNING's that gzuncompress() emits, suppress it with an @ so we can do away with the try/catch. Make a note of this in the comments.
    Switch from using tempnam() to tmpfile() because tempnam() can emit E_NOTICE's and would have to be suppressed as well. tmpfile() just returns a handle or false.
    Limit file_get_contents() by the $decodeMemoryLimit. Unlike gzuncompress() for which a limit value of zero (0) means "no limit", file_get_contents() takes null to mean "no limit".
    GreyWyvern committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    528aeb3 View commit details
    Browse the repository at this point in the history
  2. Update FilterHelper.php

    Fix for PHP < 8.0 that doesn't like a length limit of null for file_get_contents().
    GreyWyvern committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    766f616 View commit details
    Browse the repository at this point in the history