monderazarnino / php-mime-mail-parser

Automatically exported from code.google.com/p/php-mime-mail-parser
0 stars 0 forks source link

Error shown : Undefined index: content-transfer-encoding in /path/to/php-mime-mail-parser/MimeMailParser.class.php on line 193 #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Set php error reporting to E_ALL ( error_reporting(E_ALL); )
2. Take an email with no content encoding defined (e.g. it has no 
'content-transfer-encoding' header)
3. Parse the email and display some part of it

What is the expected output? What do you see instead?
You would expect to see merely the part that you've displayed.
Instead, in addition to the part displayed is an error message like :

PHP Notice:  Undefined index: content-transfer-encoding in 
/path/to/php-mime-mail-parser/MimeMailParser.class.php on line 193

What version of the product are you using? On what operating system?
r16
PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:49:46) 
Ubuntu 10.04.1 LTS
Linux 2.6.32-25-generic

Please provide any additional information below.
I've attached a patch which fixes this problem by doing an "array_key_exists" 
check before assuming that there is a 'content-transfer-encoding' header. In 
the absence of the header it passes an empty string to the private "decode" 
method so that no decoding occurs. 

Original issue reported on code.google.com by gene.wood.temp on 21 Oct 2010 at 9:58

Attachments:

GoogleCodeExporter commented 8 years ago
This patch has been incorporated into trunk as of r21
This issue should be resolved now. Feel free to test and comment or Verify the 
issue.

Original comment by gene.wood.temp on 22 Oct 2010 at 4:16