zoe Tue Dec 16 21:10:16 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/imap php_imap.c
Log:
bug #46884 fix
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.25&r2=1.208.2.7.2.26.2.26&diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.25
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.26
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.25 Wed Dec 3 16:52:04 2008
+++ php-src/ext/imap/php_imap.c Tue Dec 16 21:10:16 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates: Zeev Suraski <[email protected]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.25 2008/12/03 16:52:04 zoe Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.26 2008/12/16 21:10:16 zoe Exp $ */
#define IMAP41
@@ -1575,6 +1575,11 @@
return;
}
+ if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for
the options parameter");
+ RETURN_FALSE;
+ }
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap",
le_imap);
if ((argc == 3) && (flags & FT_UID)) {
@@ -2166,6 +2171,11 @@
if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &streamind, &msgno,
&flags) == FAILURE) {
return;
}
+
+ if (flags && ((flags & ~FT_UID) != 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for
the options parameter");
+ RETURN_FALSE;
+ }
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap",
le_imap);
@@ -2211,6 +2221,11 @@
if (zend_parse_parameters(argc TSRMLS_CC, "rls|l", &streamind, &msgno,
&sec, &sec_len, &flags) == FAILURE) {
return;
}
+
+ if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for
the options parameter");
+ RETURN_FALSE;
+ }
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap",
le_imap);
@@ -2930,13 +2945,18 @@
PHP_FUNCTION(imap_fetchheader)
{
zval *streamind;
- long msgno, flags;
+ long msgno, flags=0L;
pils *imap_le_struct;
int msgindex, argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &streamind, &msgno,
&flags) == FAILURE) {
return;
}
+
+ if (flags && ((flags & ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for
the options parameter");
+ RETURN_FALSE;
+ }
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap",
le_imap);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php