From bbde60d6d2c763924c0977a6a2aa21bfba713197 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 12 Aug 2004 19:20:17 +0000 Subject: [PATCH] MFH: Properly fix the msgno check inside imap_fetchbody(). --- ext/imap/php_imap.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index c8f5993e60..04eb01e159 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1816,13 +1816,12 @@ PHP_FUNCTION(imap_fetchbody) if (myargc == 4) { convert_to_long_ex(flags); } - - if (myargc < 4 || !Z_LVAL_PP(flags) & FT_UID) { - /* If we're fetching via UID, checking the range of msgno is - DUMB. */ - PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno)); - } - + + if (myargc < 4 || !(Z_LVAL_PP(flags) & FT_UID)) { + /* only perform the check if the msgno is a message number and not a UID */ + PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno)); + } + body = mail_fetchbody_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), Z_STRVAL_PP(sec), &len, myargc==4 ? Z_LVAL_PP(flags) : NIL); if (!body) { -- 2.50.1