Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/standard/filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ static php_conv_err_t php_conv_qprint_decode_convert(php_conv_qprint_decode *ins
err = PHP_CONV_ERR_INVALID_SEQ;
goto out;
}
next_char = (next_char << 4) | (*ps >= 'A' ? *ps - 0x37 : *ps - 0x30);
next_char = (next_char << 4) | (*ps >= 'a' ? *ps - 0x57 : (*ps >= 'A' ? *ps - 0x37 : *ps - 0x30));
scan_stat++;
ps++, icnt--;
if (scan_stat != 3) {
Expand Down
20 changes: 20 additions & 0 deletions ext/standard/tests/filters/qp_decode_lowercase.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
convert.quoted-printable-decode: lowercase hex digits decode correctly
--FILE--
<?php
foreach (['=cd', '=0a', '=da', '=CD', '=AB', '=ab'] as $in) {
$fp = fopen('php://temp', 'r+');
fwrite($fp, $in);
rewind($fp);
stream_filter_append($fp, 'convert.quoted-printable-decode', STREAM_FILTER_READ);
echo $in, ' => ', bin2hex(stream_get_contents($fp)), "\n";
fclose($fp);
}
?>
--EXPECT--
=cd => cd
=0a => 0a
=da => da
=CD => cd
=AB => ab
=ab => ab
Loading