rendered paste body### Eclipse Workspace Patch 1.0
#P php6
Index: ext/imap/php_imap.c
===================================================================
RCS file: /repository/php-src/ext/imap/php_imap.c,v
retrieving revision 1.265
diff -u -r1.265 php_imap.c
--- ext/imap/php_imap.c 5 Dec 2008 11:57:24 -0000 1.265
+++ ext/imap/php_imap.c 16 Dec 2008 17:00:47 -0000
@@ -1560,6 +1560,12 @@
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)) {
@@ -2151,6 +2157,12 @@
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);
@@ -2197,6 +2209,12 @@
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 < 4 || !(flags & FT_UID)) {
@@ -2915,13 +2933,20 @@
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);