Bug #81649 [Opn]: imap_delete uses string $message_num, other functions in $message_num

From: Date: Mon, 22 Nov 2021 16:08:30 +0000
Subject: Bug #81649 [Opn]: imap_delete uses string $message_num, other functions in $message_num
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237920@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81649&edit=1 ID: 81649 Updated by: cmb@php.net Reported by: valeri dot geiser at km-logistik-service dot de Summary: imap_delete uses string $message_num, other functions in $message_num Status: Open Type: Bug Package: IMAP related Operating System: Debian GNU/Linux PHP Version: 7.4.26 Block user comment: N Private report: N New Comment: > […] i.e. it should be string $message_nums as in imap_mail_copy […] Sounds right (modulo the BC break). Anyhow, the docs have been fixed: <https://github.com/php/doc-en/commit/620dfaa2440aeb9324ff34fa7b162eb7d64ae6b9>. Previous Comments: ------------------------------------------------------------------------ [2021-11-22 15:05:48] valeri dot geiser at km-logistik-service dot de Then it should be consistent with the other ones that take sequences, i.e. it should be string $message_nums as in imap_mail_copy and all(?) other functions that use sequences. ------------------------------------------------------------------------ [2021-11-22 14:36:36] cmb@php.net Contrary to the other functions, imap_delete() and imap_undelete() actually accept a *sequence*, and from lib-cclient's internal.txt[1]: | [Note!! There is an important difference between a "sequence" and a | "msgno". A sequence is a string representing one or more messages in | IMAP4-style sequence format ("n", "n:m", or combination of these | delimited by commas), whereas a msgno is an int representing a single | message.] So we cannot change the types, but may consider to change the parameter names (although that would be a BC break wrt. named parameters). But in any way, we should fix the docs. [1] <https://github.com/winlibs/imap/blob/imap-2007f/docs/internal.txt#L1255-L1259> ------------------------------------------------------------------------ [2021-11-22 13:58:22] valeri dot geiser at km-logistik-service dot de Description: ------------ imap_delete and imap_undelete use string $message_num in the signature whereas all other functions use int $message_num: imap_body imap_bodystruct imap_bodystruct imap_fetchbody imap_fetchheader imap_fetchmime imap_fetchstructure imap_fetchtext imap_header imap_headerinfo imap_savebody imap_uid This is incosistent (at least from user point of view) and leads to errors. Expected result: ---------------- Signature consistently using int as type for $message_num ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81649&edit=1

« previous php.bugs (#237920) next »