]> granicus.if.org Git - php/commitdiff
Fix for #8359. imap_fetchheader should never return the full message; the
authorChuck Hagenbuch <chagenbu@php.net>
Thu, 3 May 2001 19:18:48 +0000 (19:18 +0000)
committerChuck Hagenbuch <chagenbu@php.net>
Thu, 3 May 2001 19:18:48 +0000 (19:18 +0000)
FT_PREFETCHTEXT flag is just a hint to c-client that you'll be asking for
the message text next.

ext/imap/php_imap.c

index 649406a56088c0f6f0bef5a4425636c430647ba7..d81de05344f27bfe9e773329aaec5c7ed9587388 100644 (file)
@@ -2808,17 +2808,7 @@ PHP_FUNCTION(imap_fetchheader)
                RETURN_FALSE;
        }
 
-       if ((myargc == 3) && (Z_LVAL_PP(flags) & FT_PREFETCHTEXT)) {
-               header = mail_fetchheader_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL, &hlen, Z_LVAL_PP(flags));
-               body = mail_fetchtext_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), &blen, Z_LVAL_PP(flags));
-               tempstring = emalloc(hlen+blen+1);
-               strcpy(tempstring,header);
-               strcat(tempstring,body);
-               RETVAL_STRINGL(tempstring,(hlen+blen+1),1);
-               efree(tempstring);
-       } else {
-               RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL, NIL, (myargc == 3 ? Z_LVAL_PP(flags) : NIL)), 1);
-       }
+    RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL, NIL, (myargc == 3 ? Z_LVAL_PP(flags) : NIL)), 1);
 }
 /* }}} */