summaryrefslogtreecommitdiff
path: root/ext/imap/php_imap.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r--ext/imap/php_imap.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 011cbc0dfd..6ce4b78179 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2017 The PHP Group |
+ | Copyright (c) 1997-2018 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -1099,6 +1099,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
}
}
mail_free_errorlist(&IMAPG(imap_errorstack));
+ IMAPG(imap_errorstack) = NIL;
}
if (IMAPG(imap_alertstack) != NIL) {
@@ -1331,18 +1332,18 @@ PHP_FUNCTION(imap_append)
zend_string *folder, *message, *internal_date = NULL, *flags = NULL;
pils *imap_le_struct;
STRING st;
- zend_string* regex;
- pcre_cache_entry *pce; /* Compiled regex */
- zval *subpats = NULL; /* Parts (not used) */
- int global = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rSS|SS", &streamind, &folder, &message, &flags, &internal_date) == FAILURE) {
return;
}
- regex = zend_string_init("/[0-3][0-9]-((Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|(Nov)|(Dec))-[0-9]{4} [0-2][0-9]:[0-5][0-9]:[0-5][0-9] [+-][0-9]{4}/", sizeof("/[0-3][0-9]-((Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|(Nov)|(Dec))-[0-9]{4} [0-2][0-9]:[0-5][0-9]:[0-5][0-9] [+-][0-9]{4}/") - 1, 0);
if (internal_date) {
+ zend_string *regex = zend_string_init("/[0-3][0-9]-((Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|(Nov)|(Dec))-[0-9]{4} [0-2][0-9]:[0-5][0-9]:[0-5][0-9] [+-][0-9]{4}/", sizeof("/[0-3][0-9]-((Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|(Nov)|(Dec))-[0-9]{4} [0-2][0-9]:[0-5][0-9]:[0-5][0-9] [+-][0-9]{4}/") - 1, 0);
+ pcre_cache_entry *pce; /* Compiled regex */
+ zval *subpats = NULL; /* Parts (not used) */
+ int global = 0;
+
/* Make sure the given internal_date string matches the RFC specifiedformat */
if ((pce = pcre_get_compiled_regex_cache(regex))== NULL) {
zend_string_free(regex);
@@ -1359,7 +1360,6 @@ PHP_FUNCTION(imap_append)
}
}
- zend_string_free(regex);
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
}
@@ -2931,7 +2931,7 @@ PHP_FUNCTION(imap_utf7_decode)
#if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
- php_error_docref(NULL, E_WARNING, "outp - out [%ld] != outlen [%d]", outp - out, outlen);
+ php_error_docref(NULL, E_WARNING, "outp - out [%zd] != outlen [%d]", outp - out, outlen);
}
#endif
@@ -4464,7 +4464,7 @@ static zend_string* _php_rfc822_write_address(ADDRESS *addresslist)
char address[SENDBUFLEN];
if (_php_imap_address_size(addresslist) >= SENDBUFLEN) {
- php_error_docref(NULL, E_ERROR, "Address buffer overflow");
+ zend_throw_error(NULL, "Address buffer overflow");
return NULL;
}
address[0] = 0;