[GIT-PULLS] [php-src] PR #22870: Fix convert.quoted-printable-decode of lowercase hex digits

[email protected] (iliaal) Thu, 23 Jul 2026 14:05:10 +0000
Newsgroups php.git-pulls
Message-ID <[email protected]>
Pull Request: https://github.com/php/php-src/pull/22870
Author: iliaal

The convert.quoted-printable-decode stream filter accepts lowercase hex digits (isxdigit() passes a-f) but its nibble math only handles uppercase, so a hex escape with a lowercase digit decodes to the wrong byte. quoted_printable_decode() decodes lowercase correctly, so the filter and the function disagree.

    $fp = fopen('php://temp', 'r+');
    fwrite($fp, '=cd'); rewind($fp);
    stream_filter_append($fp, 'convert.quoted-printable-decode', STREAM_FILTER_READ);
    var_dump(bin2hex(stream_get_contents($fp))); // "ed", should be "cd"