Skip to content

Commit a6acaa3

Browse files
committed
Amend error messages
1 parent 7b11212 commit a6acaa3

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

ext/imap/php_imap.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,7 @@ PHP_FUNCTION(imap_open)
715715

716716
if (flags && ((flags & ~(OP_READONLY | OP_ANONYMOUS | OP_HALFOPEN | CL_EXPUNGE | OP_DEBUG | OP_SHORTCACHE
717717
| OP_SILENT | OP_PROTOTYPE | OP_SECURE)) != 0)) {
718-
zend_argument_value_error(4, "must be a bitmask of OP_READONLY, OP_ANONYMOUS, OP_HALFOPEN, CL_EXPUNGE, "
719-
"OP_DEBUG, OP_SHORTCACHE, OP_SILENT, OP_PROTOTYPE, and OP_SECURE");
718+
zend_argument_value_error(4, "must be a bitmask of the OP_* constants, and CL_EXPUNGE");
720719
RETURN_THROWS();
721720
}
722721

@@ -2720,7 +2719,7 @@ PHP_FUNCTION(imap_sort)
27202719

27212720
if (!(sort == SORTDATE || sort == SORTARRIVAL || sort == SORTFROM || sort == SORTSUBJECT || sort == SORTTO ||
27222721
sort == SORTCC || sort == SORTSIZE) ) {
2723-
zend_argument_value_error(2, "must be one of SORTDATE, SORTARRIVAL, SORTFROM, SORTSUBJECT, SORTTO, SORTCC, or SORTSIZE");
2722+
zend_argument_value_error(2, "must be one of the SORT* constants");
27242723
RETURN_THROWS();
27252724
}
27262725

@@ -2860,8 +2859,7 @@ PHP_FUNCTION(imap_status)
28602859
}
28612860

28622861
if (flags && ((flags & ~(SA_MESSAGES | SA_RECENT | SA_UNSEEN | SA_UIDNEXT | SA_UIDVALIDITY /*| SA_ALL*/)) != 0)) {
2863-
zend_argument_value_error(3, "must be a bitmask of SA_MESSAGES, SA_RECENT, SA_UNSEEN, "
2864-
"SA_UIDNEXT, SA_UIDVALIDITY, and SA_ALL");
2862+
zend_argument_value_error(3, "must be a bitmask of SA_* constants");
28652863
RETURN_THROWS();
28662864
}
28672865

ext/imap/tests/imap_open_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ try {
3232
Checking with incorrect parameters
3333

3434
Warning: imap_open(): Couldn't open stream in %s on line %d
35-
imap_open(): Argument #4 ($options) must be a bitmask of OP_READONLY, OP_ANONYMOUS, OP_HALFOPEN, CL_EXPUNGE, OP_DEBUG, OP_SHORTCACHE, OP_SILENT, OP_PROTOTYPE, and OP_SECURE
35+
imap_open(): Argument #4 ($options) must be a bitmask of the OP_* constants, and CL_EXPUNGE
3636
imap_open(): Argument #5 ($n_retries) must be greater than or equal to 0
3737

3838
Notice: Unknown: Can't open mailbox : no such mailbox (errflg=2) in Unknown on line 0

0 commit comments

Comments
 (0)