#35904 [Bgs]: iconv_mime_decode_headers need trim($headers) before using it

From: Date: Thu, 05 Jan 2006 12:10:09 +0000
Subject: #35904 [Bgs]: iconv_mime_decode_headers need trim($headers) before using it
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91542@lists.php.net to get a copy of this message
ID: 35904 User updated by: eugen at id dot com dot ua Reported By: eugen at id dot com dot ua Status: Bogus Bug Type: ICONV related Operating System: Linux kernel 2.6.9 PHP Version: 5.1.2RC1 New Comment: Even if iconv_mime_decode_headers( $headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR ); it returns empty array. Is it as should be? Previous Comments: ------------------------------------------------------------------------ [2006-01-05 13:05:15] tony2001@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ------------------------------------------------------------------------ [2006-01-05 13:03:19] eugen at id dot com dot ua Description: ------------ If headers contain leading newline, iconv_mime_decode_headers return empty array instead of parsed headers array Reproduce code: --------------- $headers = ' Subject: Test From: myself@dot.com '; print_r(iconv_mime_decode_headers($headers)); /* Note, that $headers string start with newline*/ Expected result: ---------------- Array ( [Subject] => Test [From] => myself@dot.com ) Actual result: -------------- Array ( ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35904&edit=1

« previous php.bugs (#91542) next »