From:  pear-qa@lists.php.net ("slgundam@gmail.com")
Date:  22 Feb 2018 03:53:22 Hong Kong Time
Newsgroup:  news.php.net/php.pear.bugs
Subject:  

[PEAR-BUG] Bug #21136 [Com]: Empty header value causes notice

NNTP-Posting-Host:  null

Edit report at https://pear.php.net/bugs/bug.php?id=21136&edit=1

 ID:               21136
 Comment by:       slgundam at gmail dot com
 Reported By:      jorrit at ncode dot nl
 Summary:          Empty header value causes notice
 Status:           Open
 Type:             Bug
 Package:          Mail_mimeDecode
 Operating System: Linux
 Package Version:  1.5.6
 PHP Version:      Irrelevant
 Roadmap Versions: 
 New Comment:

"isset($hdr_value[0]) && " should fix this as well


Previous Comments:
------------------------------------------------------------------------

[2016-10-25 03:04:21] jorrit

Description:
------------
On line 492 of mimeDecode.php the first space of the header value is
removed. However, I encounter mails that have an empty $hdr_value so
checking $hdr_value[0] causes a 'Uninitialized string offset: 0' notice
in PHP 7. The addition of a simple '!empty($hdr_value) &&  ' would fix
this.

Test script:
---------------
decode([]);


Expected result:
----------------
No notices

Actual result:
--------------
The notice mentioned above.

------------------------------------------------------------------------


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=21136&edit=1