]> granicus.if.org Git - php/commitdiff
MFH: Properly fix the msgno check inside imap_fetchbody().
authorIlia Alshanetsky <iliaa@php.net>
Thu, 12 Aug 2004 19:20:19 +0000 (19:20 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 12 Aug 2004 19:20:19 +0000 (19:20 +0000)
ext/imap/php_imap.c

index 1715a6e5753cc570deb7fc35656ad3bbf54efc7e..3fa6f42b97a574d9fe0a5a96ec4a6b2cc3c37ff5 100644 (file)
@@ -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) {