1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00

Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #77147: Fix for 60494 ignores ICONV_MIME_DECODE_CONTINUE_ON_ERROR
This commit is contained in:
Christoph M. Becker
2018-11-14 14:58:45 +01:00
3 changed files with 30 additions and 1 deletions
+5 -1
View File
@@ -1536,7 +1536,11 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
default: /* first letter of a non-encoded word */
err = _php_iconv_appendc(pretval, *p1, cd_pl);
if (err != PHP_ICONV_ERR_SUCCESS) {
goto out;
if (mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR) {
err = PHP_ICONV_ERR_SUCCESS;
} else {
goto out;
}
}
encoded_word = NULL;
if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) {
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #77147 (Fixing 60494 ignored ICONV_MIME_DECODE_CONTINUE_ON_ERROR)
--SKIPIF--
<?php
if (!extension_loaded('iconv')) die('skip iconv extension not available');
?>
--FILE--
<?php
$string = <<<EOF
Feedback-ID: 014a93e3-1f5e-4df6-b347-6b59f0f746b8:b5891053-55d1-45bc-a0b5-47a7a9b59687:email:epslh1
EOF;
$headers = iconv_mime_decode_headers($string, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
var_dump($headers);
?>
===DONE===
--EXPECT--
array(1) {
["Feedback-ID"]=>
string(86) "014a93e3-1f5e-4df6-b347-6b59f0f746b8:b5891053-55d1-45bc-a0b5-47a7a9b59687:email:epslh1"
}
===DONE===