php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77147 iconv_mime_decode_headers ignores ICONV_MIME_DECODE_CONTINUE_ON_ERROR flag
Submitted: 2018-11-13 22:42 UTC Modified: 2018-11-13 22:44 UTC
From: shafer_w2002 at yahoo dot com Assigned: cmb (profile)
Status: Closed Package: ICONV related
PHP Version: 7.1.24 OS: N/A
Private report: No CVE-ID: None
 [2018-11-13 22:42 UTC] shafer_w2002 at yahoo dot com
Description:
------------
The fix for bug https://bugs.php.net/bug.php?id=60494 ignores the ICONV_MIME_DECODE_CONTINUE_ON_ERROR flag and false the parse.   Prior to 7.1.22 parsing headers with erogenous characters worked fine, or as good as you were going to get anyway.

The previous behavior should be respected (ignoring these broken chars) when ICONV_MIME_DECODE_CONTINUE_ON_ERROR is set, as per the php manual.

Test script:
---------------
<?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);

print_r($headers);

Expected result:
----------------
Array
(
    [Feedback-ID] => 014a93e3-1f5e-4df6-b347-6b59f0f746b8:b5891053-55d1-45bc-a0b5-47a7a9b59687:email:epslh1
)

Actual result:
--------------
false

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-11-13 22:44 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2018-11-14 14:01 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a56cdd0a824d439920548aaeae757cb2341bd4ec
Log: Fix #77147: Fix for 60494 ignores ICONV_MIME_DECODE_CONTINUE_ON_ERROR
 [2018-11-14 14:01 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Wed Dec 19 04:01:26 2018 UTC