summaryrefslogtreecommitdiff
path: root/ext/imap/php_imap.c
diff options
context:
space:
mode:
authorZoe Slattery <zoe@php.net>2008-12-16 21:35:01 +0000
committerZoe Slattery <zoe@php.net>2008-12-16 21:35:01 +0000
commit78d7ff706e1cbd3c1347ed998bd256db5e00c7bc (patch)
tree460541f9b39b1e349934558ace02781a256f6e7a /ext/imap/php_imap.c
parent92d3eb31b71a746fad5e49b50071d6e5d46ea3e2 (diff)
downloadphp-git-78d7ff706e1cbd3c1347ed998bd256db5e00c7bc.tar.gz
bug #46837 fix
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r--ext/imap/php_imap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index fd89734e45..fecaf42dfb 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -1498,6 +1498,13 @@ PHP_FUNCTION(imap_close)
if (argc == 2) {
flags = options;
+
+ /* Check that flags is exactly equal to PHP_EXPUNGE or zero */
+ if (flags && ((flags & ~PHP_EXPUNGE) != 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the flags parameter");
+ RETURN_FALSE;
+ }
+
/* Do the translation from PHP's internal PHP_EXPUNGE define to c-client's CL_EXPUNGE */
if (flags & PHP_EXPUNGE) {
flags ^= PHP_EXPUNGE;