From: Ilia Alshanetsky Date: Thu, 12 Aug 2004 19:20:19 +0000 (+0000) Subject: MFH: Properly fix the msgno check inside imap_fetchbody(). X-Git-Tag: php-4.3.9RC2~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6debc5600e24cc783dbb25c39d4d32b9330e1ec;p=php MFH: Properly fix the msgno check inside imap_fetchbody(). --- diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 1715a6e575..3fa6f42b97 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1775,13 +1775,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) {