]> granicus.if.org Git - php/commitdiff
- MFB: Fixed bug #45460 (imap patch for fromlength fix in imap_headerinfo doesn't...
authorFelipe Pena <felipe@php.net>
Thu, 10 Jul 2008 17:54:08 +0000 (17:54 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 10 Jul 2008 17:54:08 +0000 (17:54 +0000)
ext/imap/php_imap.c

index 387f6f13324cdfcc4ddb1c035e36796fc98a3efe..30e9497148d0054f094d7dd8cc19109e16ffe4c6 100644 (file)
@@ -2007,8 +2007,8 @@ PHP_FUNCTION(imap_headerinfo)
        convert_to_long_ex(msgno);
        if (myargc >= 3) {
                convert_to_long_ex(fromlength);
-               if (Z_LVAL_PP(fromlength) < 0 || Z_LVAL_PP(fromlength) >= MAILTMPLEN) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be between 1 and %i", MAILTMPLEN);
+               if (Z_LVAL_PP(fromlength) < 0 || Z_LVAL_PP(fromlength) > MAILTMPLEN) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be between 0 and %d", MAILTMPLEN);
                        RETURN_FALSE;
                }
        } else {
@@ -2016,8 +2016,8 @@ PHP_FUNCTION(imap_headerinfo)
        }
        if (myargc >= 4) {
                convert_to_long_ex(subjectlength);
-               if (Z_LVAL_PP(subjectlength) < 0 || Z_LVAL_PP(subjectlength) >= MAILTMPLEN) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be between 1 and %i", MAILTMPLEN);
+               if (Z_LVAL_PP(subjectlength) < 0 || Z_LVAL_PP(subjectlength) > MAILTMPLEN) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be between 0 and %d", MAILTMPLEN);
                        RETURN_FALSE;
                }
        } else {