cvs: pecl /mailparse php_mailparse_mime.c
| From: | Brian Shire | Date: | Wed, 05 Sep 2007 08:14:09 +0000 |
| Subject: | cvs: pecl /mailparse php_mailparse_mime.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-8509@lists.php.net to get a copy of this message | ||
shire Wed Sep 5 08:14:09 2007 UTC
Modified files:
/pecl/mailparse php_mailparse_mime.c
Log:
fix incorrect handling of header continuation lines per RFC2822 (patch by Jakub Klos)
http://cvs.php.net/viewvc.cgi/pecl/mailparse/php_mailparse_mime.c?r1=1.18&r2=1.19&diff_format=u
Index: pecl/mailparse/php_mailparse_mime.c
diff -u pecl/mailparse/php_mailparse_mime.c:1.18 pecl/mailparse/php_mailparse_mime.c:1.19
--- pecl/mailparse/php_mailparse_mime.c:1.18 Tue Aug 21 20:17:37 2007
+++ pecl/mailparse/php_mailparse_mime.c Wed Sep 5 08:14:09 2007
@@ -15,7 +15,7 @@
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_mailparse_mime.c,v 1.18 2007/08/21 20:17:37 shire Exp $ */
+/* $Id: php_mailparse_mime.c,v 1.19 2007/09/05 08:14:09 shire Exp $ */
#include "php.h"
#include "php_mailparse.h"
@@ -443,12 +443,15 @@
php_mimepart_update_positions(workpart, workpart->endpos + origcount, workpart->endpos +
linelen, 1);
if (isspace((int)(unsigned char)*c)) {
- smart_str_appendl(&workpart->parsedata.headerbuf, " ", 1);
+
+ /* save header for possible continuation without the first char */
+ smart_str_appendl(&workpart->parsedata.headerbuf, c+1, linelen-1);
} else {
php_mimepart_process_header(workpart TSRMLS_CC);
+
+ /* save header for possible continuation */
+ smart_str_appendl(&workpart->parsedata.headerbuf, c, linelen);
}
- /* save header for possible continuation */
- smart_str_appendl(&workpart->parsedata.headerbuf, c, linelen);
} else {
/* end of headers */