diff options
author | George Peter Banyard <girgias@php.net> | 2020-11-30 14:08:49 +0000 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2020-11-30 14:08:49 +0000 |
commit | e42bf726c051d5367484b45fe18b06e3d7d783c9 (patch) | |
tree | 22f38290b460f606ccb2c8ffeb9a8394f1d063f0 /ext/imap/php_imap.c | |
parent | 39c59e084c8f5fc9b0ce379fbf62dbdf547e400b (diff) | |
parent | 0076b47326e53d98b5df56c5f970b2b5cc3d9b6d (diff) | |
download | php-git-e42bf726c051d5367484b45fe18b06e3d7d783c9.tar.gz |
Merge branch 'PHP-8.0'
* PHP-8.0:
Fix Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0
Rename XmlParser to XMLParser for consistency with XMLWriter/XMLReader
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r-- | ext/imap/php_imap.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 4c72c90ff6..0ad01af483 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2835,10 +2835,10 @@ PHP_FUNCTION(imap_uid) PHP_FUNCTION(imap_msgno) { zval *streamind; - zend_long msgno; + zend_long msg_uid; pils *imap_le_struct; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &msgno) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &msg_uid) == FAILURE) { RETURN_THROWS(); } @@ -2846,9 +2846,13 @@ PHP_FUNCTION(imap_msgno) RETURN_THROWS(); } - PHP_IMAP_CHECK_MSGNO(msgno, 2); + /* Do NOT use the PHP_IMAP_CHECK_MSGNO() macro as UID cannot be checked for their upper bound. */ + if (msg_uid < 1) { + zend_argument_value_error(2, "must be greater than 0"); + RETURN_THROWS(); + } - RETURN_LONG(mail_msgno(imap_le_struct->imap_stream, msgno)); + RETURN_LONG(mail_msgno(imap_le_struct->imap_stream, msg_uid)); } /* }}} */ |