summaryrefslogtreecommitdiff
path: root/ext/imap/php_imap.c
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2009-04-25 16:33:51 +0000
committerPierre Joye <pajoye@php.net>2009-04-25 16:33:51 +0000
commitbf58dedbdf076cd270bfa595977943edd86900f4 (patch)
treec5cebc0d0b974ea64f74c8f55ba57b9681b166e9 /ext/imap/php_imap.c
parentf30aaa1d6d2401764c030737ee6d2a8c29dfbe60 (diff)
downloadphp-git-bf58dedbdf076cd270bfa595977943edd86900f4.tar.gz
- ws
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r--ext/imap/php_imap.c350
1 files changed, 175 insertions, 175 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index a0bbbb13ec..0a627242e0 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -598,7 +598,7 @@ static void mail_close_it(zend_rsrc_list_entry *rsrc TSRMLS_DC)
static int add_assoc_object(zval *arg, char *key, zval *tmp TSRMLS_DC)
{
HashTable *symtable;
-
+
if (Z_TYPE_P(arg) == IS_OBJECT) {
symtable = Z_OBJPROP_P(arg);
} else {
@@ -613,14 +613,14 @@ static int add_assoc_object(zval *arg, char *key, zval *tmp TSRMLS_DC)
static inline int add_next_index_object(zval *arg, zval *tmp TSRMLS_DC)
{
HashTable *symtable;
-
+
if (Z_TYPE_P(arg) == IS_OBJECT) {
symtable = Z_OBJPROP_P(arg);
} else {
symtable = Z_ARRVAL_P(arg);
}
- return zend_hash_next_index_insert(symtable, (void *) &tmp, sizeof(zval *), NULL);
+ return zend_hash_next_index_insert(symtable, (void *) &tmp, sizeof(zval *), NULL);
}
/* }}} */
@@ -691,7 +691,7 @@ void mail_free_errorlist(ERRORLIST **errlist)
/* }}} */
/* {{{ mail_newmessagelist
- *
+ *
* Mail instantiate MESSAGELIST
* Returns: new MESSAGELIST list
* Author: CJH
@@ -722,8 +722,8 @@ void mail_free_messagelist(MESSAGELIST **msglist, MESSAGELIST **tail)
}
/* }}} */
-#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
-/* {{{ mail_getquota
+#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
+/* {{{ mail_getquota
*
* Mail GET_QUOTA callback
* Called via the mail_parameter function in c-client:src/c-client/mail.c
@@ -734,7 +734,7 @@ void mail_getquota(MAILSTREAM *stream, char *qroot, QUOTALIST *qlist)
{
zval *t_map, *return_value;
TSRMLS_FETCH();
-
+
return_value = *IMAPG(quota_return);
/* put parsing code here */
@@ -829,7 +829,7 @@ PHP_MINIT_FUNCTION(imap)
#ifndef PHP_WIN32
auth_link(&auth_log); /* link in the log authenticator */
- auth_link(&auth_md5); /* link in the cram-md5 authenticator */
+ auth_link(&auth_md5); /* link in the cram-md5 authenticator */
#if HAVE_IMAP_KRB && defined(HAVE_IMAP_AUTH_GSS)
auth_link(&auth_gss); /* link in the gss authenticator */
#endif
@@ -879,13 +879,13 @@ PHP_MINIT_FUNCTION(imap)
REGISTER_LONG_CONSTANT("OP_SECURE", OP_SECURE, CONST_PERSISTENT | CONST_CS);
/* don't do non-secure authentication */
- /*
+ /*
PHP re-assigns CL_EXPUNGE a custom value that can be used as part of the imap_open() bitfield
- because it seems like a good idea to be able to indicate that the mailbox should be
+ because it seems like a good idea to be able to indicate that the mailbox should be
automatically expunged during imap_open in case the script get interrupted and it doesn't get
to the imap_close() where this option is normally placed. If the c-client library adds other
- options and the value for this one conflicts, simply make PHP_EXPUNGE higher at the top of
- this file
+ options and the value for this one conflicts, simply make PHP_EXPUNGE higher at the top of
+ this file
*/
REGISTER_LONG_CONSTANT("CL_EXPUNGE", PHP_EXPUNGE, CONST_PERSISTENT | CONST_CS);
/* expunge silently */
@@ -1143,8 +1143,8 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
MAILSTREAM *imap_stream;
pils *imap_le_struct;
int argc = ZEND_NUM_ARGS();
-
- if (zend_parse_parameters(argc TSRMLS_CC, "sss|ll", &mailbox, &mailbox_len, &user, &user_len,
+
+ if (zend_parse_parameters(argc TSRMLS_CC, "sss|ll", &mailbox, &mailbox_len, &user, &user_len,
&passwd, &passwd_len, &flags, &retries) == FAILURE) {
return;
}
@@ -1156,17 +1156,17 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
- if (IMAPG(imap_user)) {
+ if (IMAPG(imap_user)) {
efree(IMAPG(imap_user));
}
- if (IMAPG(imap_password)) {
+ if (IMAPG(imap_password)) {
efree(IMAPG(imap_password));
}
/* local filename, need to perform open_basedir and safe_mode checks */
- if (mailbox[0] != '{' &&
- (php_check_open_basedir(mailbox TSRMLS_CC) ||
+ if (mailbox[0] != '{' &&
+ (php_check_open_basedir(mailbox TSRMLS_CC) ||
(PG(safe_mode) && !php_checkuid(mailbox, NULL, CHECKUID_CHECK_FILE_AND_DIR)))) {
RETURN_FALSE;
}
@@ -1195,7 +1195,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
imap_le_struct = emalloc(sizeof(pils));
imap_le_struct->imap_stream = imap_stream;
- imap_le_struct->flags = cl_flags;
+ imap_le_struct->flags = cl_flags;
ZEND_REGISTER_RESOURCE(return_value, imap_le_struct, le_imap);
}
@@ -1217,7 +1217,7 @@ PHP_FUNCTION(imap_reopen)
char *mailbox;
int mailbox_len;
long options = 0, retries = 0;
- pils *imap_le_struct;
+ pils *imap_le_struct;
MAILSTREAM *imap_stream;
long flags=NIL;
long cl_flags=NIL;
@@ -1234,7 +1234,7 @@ PHP_FUNCTION(imap_reopen)
cl_flags = CL_EXPUNGE;
flags ^= PHP_EXPUNGE;
}
- imap_le_struct->flags = cl_flags;
+ imap_le_struct->flags = cl_flags;
}
#ifdef SET_MAXLOGINTRIALS
if (retries) {
@@ -1242,8 +1242,8 @@ PHP_FUNCTION(imap_reopen)
}
#endif
/* local filename, need to perform open_basedir and safe_mode checks */
- if (mailbox[0] != '{' &&
- (php_check_open_basedir(mailbox TSRMLS_CC) ||
+ if (mailbox[0] != '{' &&
+ (php_check_open_basedir(mailbox TSRMLS_CC) ||
(PG(safe_mode) && !php_checkuid(mailbox, NULL, CHECKUID_CHECK_FILE_AND_DIR)))) {
RETURN_FALSE;
}
@@ -1271,7 +1271,7 @@ PHP_FUNCTION(imap_append)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|s", &streamind, &folder, &folder_len, &message, &message_len, &flags, &flags_len) == FAILURE) {
return;
}
-
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
INIT (&st, mail_string, (void *) message, message_len);
@@ -1289,7 +1289,7 @@ PHP_FUNCTION(imap_append)
PHP_FUNCTION(imap_num_msg)
{
zval *streamind;
- pils *imap_le_struct;
+ pils *imap_le_struct;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
return;
@@ -1306,7 +1306,7 @@ PHP_FUNCTION(imap_num_msg)
PHP_FUNCTION(imap_ping)
{
zval *streamind;
- pils *imap_le_struct;
+ pils *imap_le_struct;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
return;
@@ -1413,7 +1413,7 @@ PHP_FUNCTION(imap_set_quota)
limits.text.size = mailbox_size;
limits.next = NIL;
- RETURN_BOOL(imap_setquota(imap_le_struct->imap_stream, qroot, &limits));
+ RETURN_BOOL(imap_setquota(imap_le_struct->imap_stream, qroot, &limits));
}
/* }}} */
@@ -1425,7 +1425,7 @@ PHP_FUNCTION(imap_setacl)
char *mailbox, *id, *rights;
int mailbox_len, id_len, rights_len;
pils *imap_le_struct;
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &streamind, &mailbox, &mailbox_len, &id, &id_len, &rights, &rights_len) == FAILURE) {
return;
}
@@ -1477,7 +1477,7 @@ PHP_FUNCTION(imap_getacl)
PHP_FUNCTION(imap_expunge)
{
zval *streamind;
- pils *imap_le_struct;
+ pils *imap_le_struct;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
return;
@@ -1496,7 +1496,7 @@ PHP_FUNCTION(imap_expunge)
PHP_FUNCTION(imap_close)
{
zval *streamind;
- pils *imap_le_struct=NULL;
+ pils *imap_le_struct=NULL;
long options = 0, flags = NIL;
int argc = ZEND_NUM_ARGS();
@@ -1513,13 +1513,13 @@ PHP_FUNCTION(imap_close)
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;
flags |= CL_EXPUNGE;
- }
+ }
imap_le_struct->flags = flags;
}
@@ -1534,21 +1534,21 @@ PHP_FUNCTION(imap_close)
PHP_FUNCTION(imap_headers)
{
zval *streamind;
- pils *imap_le_struct;
+ pils *imap_le_struct;
unsigned long i;
char *t;
unsigned int msgno;
char tmp[MAILTMPLEN];
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
return;
}
-
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
/* Initialize return array */
array_init(return_value);
-
+
for (msgno = 1; msgno <= imap_le_struct->imap_stream->nmsgs; msgno++) {
MESSAGECACHE * cache = mail_elt (imap_le_struct->imap_stream, msgno);
mail_fetchstructure(imap_le_struct->imap_stream, msgno, NIL);
@@ -1585,7 +1585,7 @@ PHP_FUNCTION(imap_body)
{
zval *streamind;
long msgno, flags = 0;
- pils *imap_le_struct;
+ pils *imap_le_struct;
int msgindex, argc = ZEND_NUM_ARGS();
char *body;
unsigned long body_len = 0;
@@ -1631,7 +1631,7 @@ PHP_FUNCTION(imap_mail_copy)
long options = 0;
char *seq, *folder;
int seq_len, folder_len, argc = ZEND_NUM_ARGS();
- pils *imap_le_struct;
+ pils *imap_le_struct;
if (zend_parse_parameters(argc TSRMLS_CC, "rss|l", &streamind, &seq, &seq_len, &folder, &folder_len, &options) == FAILURE) {
return;
@@ -1655,7 +1655,7 @@ PHP_FUNCTION(imap_mail_move)
char *seq, *folder;
int seq_len, folder_len;
long options = 0;
- pils *imap_le_struct;
+ pils *imap_le_struct;
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "rss|l", &streamind, &seq, &seq_len, &folder, &folder_len, &options) == FAILURE) {
@@ -1679,7 +1679,7 @@ PHP_FUNCTION(imap_createmailbox)
zval *streamind;
char *folder;
int folder_len;
- pils *imap_le_struct;
+ pils *imap_le_struct;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
@@ -1702,7 +1702,7 @@ PHP_FUNCTION(imap_renamemailbox)
zval *streamind;
char *old_mailbox, *new_mailbox;
int old_mailbox_len, new_mailbox_len;
- pils *imap_le_struct;
+ pils *imap_le_struct;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &old_mailbox, &old_mailbox_len, &new_mailbox, &new_mailbox_len) == FAILURE) {
return;
@@ -1725,7 +1725,7 @@ PHP_FUNCTION(imap_deletemailbox)
zval *streamind;
char *folder;
int folder_len;
- pils *imap_le_struct;
+ pils *imap_le_struct;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
@@ -1748,7 +1748,7 @@ PHP_FUNCTION(imap_list)
zval *streamind;
char *ref, *pat;
int ref_len, pat_len;
- pils *imap_le_struct;
+ pils *imap_le_struct;
STRINGLIST *cur=NIL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
@@ -1759,7 +1759,7 @@ PHP_FUNCTION(imap_list)
/* set flag for normal, old mailbox list */
IMAPG(folderlist_style) = FLIST_ARRAY;
-
+
IMAPG(imap_folders) = IMAPG(imap_folders_tail) = NIL;
mail_list(imap_le_struct->imap_stream, ref, pat);
if (IMAPG(imap_folders) == NIL) {
@@ -1786,25 +1786,25 @@ PHP_FUNCTION(imap_list_full)
zval *streamind, *mboxob;
char *ref, *pat;
int ref_len, pat_len;
- pils *imap_le_struct;
+ pils *imap_le_struct;
FOBJECTLIST *cur=NIL;
char *delim=NIL;
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
-
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
/* set flag for new, improved array of objects mailbox list */
IMAPG(folderlist_style) = FLIST_OBJECT;
-
+
IMAPG(imap_folder_objects) = IMAPG(imap_folder_objects_tail) = NIL;
mail_list(imap_le_struct->imap_stream, ref, pat);
if (IMAPG(imap_folder_objects) == NIL) {
RETURN_FALSE;
}
-
+
array_init(return_value);
delim = safe_emalloc(2, sizeof(char), 0);
cur=IMAPG(imap_folder_objects);
@@ -1870,7 +1870,7 @@ PHP_FUNCTION(imap_check)
zval *streamind;
pils *imap_le_struct;
char date[100];
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
return;
}
@@ -1903,7 +1903,7 @@ PHP_FUNCTION(imap_delete)
pils *imap_le_struct;
long flags = 0;
int argc = ZEND_NUM_ARGS();
-
+
if (zend_parse_parameters(argc TSRMLS_CC, "rZ|l", &streamind, &sequence, &flags) == FAILURE) {
return;
}
@@ -1911,7 +1911,7 @@ PHP_FUNCTION(imap_delete)
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
convert_to_string_ex(sequence);
-
+
mail_setflag_full(imap_le_struct->imap_stream, Z_STRVAL_PP(sequence), "\\DELETED", (argc == 3 ? flags : NIL));
RETVAL_TRUE;
}
@@ -1929,9 +1929,9 @@ PHP_FUNCTION(imap_undelete)
if (zend_parse_parameters(argc TSRMLS_CC, "rZ|l", &streamind, &sequence, &flags) == FAILURE) {
return;
}
-
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
-
+
convert_to_string_ex(sequence);
mail_clearflag_full(imap_le_struct->imap_stream, Z_STRVAL_PP(sequence), "\\DELETED", (argc == 3 ? flags : NIL));
@@ -1951,11 +1951,11 @@ PHP_FUNCTION(imap_headerinfo)
MESSAGECACHE *cache;
ENVELOPE *en;
char dummy[2000], fulladdress[MAILTMPLEN + 1];
-
+
if (zend_parse_parameters(argc TSRMLS_CC, "rl|lls", &streamind, &msgno, &fromlength, &subjectlength, &defaulthost, &defaulthost_len) == FAILURE) {
return;
}
-
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
if (argc >= 3) {
@@ -1974,7 +1974,7 @@ PHP_FUNCTION(imap_headerinfo)
} else {
subjectlength = 0x00;
}
-
+
PHP_IMAP_CHECK_MSGNO(msgno);
if (mail_fetchstructure(imap_le_struct->imap_stream, msgno, NIL)) {
@@ -1982,13 +1982,13 @@ PHP_FUNCTION(imap_headerinfo)
} else {
RETURN_FALSE;
}
-
+
en = mail_fetchenvelope(imap_le_struct->imap_stream, msgno);
/* call a function to parse all the text, so that we can use the
same function to parse text from other sources */
_php_make_header_object(return_value, en TSRMLS_CC);
-
+
/* now run through properties that are only going to be returned
from a server, not text headers */
add_property_string(return_value, "Recent", cache->recent ? (cache->seen ? "R": "N") : " ", 1);
@@ -1997,18 +1997,18 @@ PHP_FUNCTION(imap_headerinfo)
add_property_string(return_value, "Answered", cache->answered ? "A" : " ", 1);
add_property_string(return_value, "Deleted", cache->deleted ? "D" : " ", 1);
add_property_string(return_value, "Draft", cache->draft ? "X" : " ", 1);
-
+
snprintf(dummy, sizeof(dummy), "%4ld", cache->msgno);
add_property_string(return_value, "Msgno", dummy, 1);
-
+
mail_date(dummy, cache);
add_property_string(return_value, "MailDate", dummy, 1);
-
- snprintf(dummy, sizeof(dummy), "%ld", cache->rfc822_size);
+
+ snprintf(dummy, sizeof(dummy), "%ld", cache->rfc822_size);
add_property_string(return_value, "Size", dummy, 1);
-
+
add_property_long(return_value, "udate", mail_longdate(cache));
-
+
if (en->from && fromlength) {
fulladdress[0] = 0x00;
mail_fetchfrom(fulladdress, imap_le_struct->imap_stream, msgno, fromlength);
@@ -2033,7 +2033,7 @@ PHP_FUNCTION(imap_rfc822_parse_headers)
if (zend_parse_parameters(argc TSRMLS_CC, "s|s", &headers, &headers_len, &defaulthost, &defaulthost_len) == FAILURE) {
return;
}
-
+
if (argc == 2) {
rfc822_parse_msg(&en, NULL, headers, headers_len, NULL, defaulthost, NIL);
} else {
@@ -2062,12 +2062,12 @@ PHP_FUNCTION(imap_lsub)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
-
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
/* set flag for normal, old mailbox list */
IMAPG(folderlist_style) = FLIST_ARRAY;
-
+
IMAPG(imap_sfolders) = NIL;
mail_lsub(imap_le_struct->imap_stream, ref, pat);
if (IMAPG(imap_sfolders) == NIL) {
@@ -2096,22 +2096,22 @@ PHP_FUNCTION(imap_lsub_full)
pils *imap_le_struct;
FOBJECTLIST *cur=NIL;
char *delim=NIL;
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
-
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
/* set flag for new, improved array of objects list */
IMAPG(folderlist_style) = FLIST_OBJECT;
-
+
IMAPG(imap_sfolder_objects) = IMAPG(imap_sfolder_objects_tail) = NIL;
mail_lsub(imap_le_struct->imap_stream, ref, pat);
if (IMAPG(imap_sfolder_objects) == NIL) {
RETURN_FALSE;
}
-
+
array_init(return_value);
delim = safe_emalloc(2, sizeof(char), 0);
cur=IMAPG(imap_sfolder_objects);
@@ -2148,7 +2148,7 @@ PHP_FUNCTION(imap_subscribe)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
}
-
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
if (mail_subscribe(imap_le_struct->imap_stream, folder) == T) {
@@ -2245,7 +2245,7 @@ PHP_FUNCTION(imap_fetchbody)
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;
@@ -2279,17 +2279,17 @@ PHP_FUNCTION(imap_savebody)
char *section = "";
int section_len = 0, close_stream = 1;
long msgno, flags = 0;
-
+
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZl|sl", &stream, &out, &msgno, &section, &section_len, &flags)) {
RETURN_FALSE;
}
-
+
ZEND_FETCH_RESOURCE(imap_ptr, pils *, &stream, -1, "imap", le_imap);
-
+
if (!imap_ptr) {
RETURN_FALSE;
}
-
+
switch (Z_TYPE_PP(out))
{
case IS_LONG:
@@ -2303,19 +2303,19 @@ PHP_FUNCTION(imap_savebody)
writer = php_stream_open_wrapper(Z_STRVAL_PP(out), "wb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
break;
}
-
+
if (!writer) {
RETURN_FALSE;
}
-
+
IMAPG(gets_stream) = writer;
mail_fetchbody_full(imap_ptr->imap_stream, msgno, section, NULL, flags);
IMAPG(gets_stream) = NULL;
-
+
if (close_stream) {
php_stream_close(writer);
}
-
+
RETURN_TRUE;
}
/* }}} */
@@ -2508,7 +2508,7 @@ PHP_FUNCTION(imap_rfc822_parse_adrlist)
int str_len, defaulthost_len;
ADDRESS *addresstmp;
ENVELOPE *env;
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &str, &str_len, &defaulthost, &defaulthost_len) == FAILURE) {
return;
}
@@ -2541,7 +2541,7 @@ PHP_FUNCTION(imap_rfc822_parse_adrlist)
}
add_next_index_object(return_value, tovals TSRMLS_CC);
} while ((addresstmp = addresstmp->next));
-
+
mail_free_envelope(&env);
}
/* }}} */
@@ -2553,11 +2553,11 @@ PHP_FUNCTION(imap_utf8)
char *str;
int str_len;
SIZEDTEXT src, dest;
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
return;
}
-
+
src.data = NULL;
src.size = 0;
dest.data = NULL;
@@ -2581,9 +2581,9 @@ PHP_FUNCTION(imap_utf8)
/* }}} */
-/* {{{ macros for the modified utf7 conversion functions
+/* {{{ macros for the modified utf7 conversion functions
*
- * author: Andrew Skalski <askalski@chek.com>
+ * author: Andrew Skalski <askalski@chek.com>
*/
/* tests `c' and returns true if it is a special character */
@@ -2622,10 +2622,10 @@ PHP_FUNCTION(imap_utf7_decode)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
return;
}
-
+
in = (const unsigned char *) arg;
inlen = arg_len;
-
+
/* validate and compute length of output string */
outlen = 0;
state = ST_NORMAL;
@@ -2756,7 +2756,7 @@ PHP_FUNCTION(imap_utf7_encode)
ST_ENCODE1,
ST_ENCODE2
} state;
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -2919,7 +2919,7 @@ PHP_FUNCTION(imap_sort)
SORTPGM *mypgm=NIL;
SEARCHPGM *spg=NIL;
int argc = ZEND_NUM_ARGS();
-
+
if (zend_parse_parameters(argc TSRMLS_CC, "rll|lss", &streamind, &pgm, &rev, &flags, &criteria, &criteria_len, &charset, &charset_len) == FAILURE) {
return;
}
@@ -2943,12 +2943,12 @@ PHP_FUNCTION(imap_sort)
} else {
spg = mail_newsearchpgm();
}
-
+
mypgm = mail_newsortpgm();
mypgm->reverse = rev;
mypgm->function = (short) pgm;
mypgm->next = NIL;
-
+
slst = mail_sort(imap_le_struct->imap_stream, (argc == 6 ? charset : NIL), spg, mypgm, (argc >= 4 ? flags : NIL));
if (spg) {
@@ -2957,7 +2957,7 @@ PHP_FUNCTION(imap_sort)
array_init(return_value);
if (slst != NIL && slst != 0) {
- for (sl = slst; *sl; sl++) {
+ for (sl = slst; *sl; sl++) {
add_next_index_long(return_value, *sl);
}
fs_give ((void **) &slst);
@@ -2973,7 +2973,7 @@ PHP_FUNCTION(imap_fetchheader)
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;
}
@@ -2982,9 +2982,9 @@ PHP_FUNCTION(imap_fetchheader)
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)) {
/* This should be cached; if it causes an extra RTT to the
IMAP server, then that's the price we pay for making sure
@@ -3014,7 +3014,7 @@ PHP_FUNCTION(imap_uid)
}
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
-
+
msgindex = msgno;
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
@@ -3032,7 +3032,7 @@ PHP_FUNCTION(imap_msgno)
zval *streamind;
long msgno;
pils *imap_le_struct;
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &streamind, &msgno) == FAILURE) {
return;
}
@@ -3100,16 +3100,16 @@ PHP_FUNCTION(imap_bodystruct)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &streamind, &msg, &section, &section_len) == FAILURE) {
return;
}
-
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
-
+
if (!msg || msg < 1 || (unsigned) msg > imap_le_struct->imap_stream->nmsgs) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
RETURN_FALSE;
}
object_init(return_value);
-
+
body=mail_body(imap_le_struct->imap_stream, msg, section);
if (body == NULL) {
zval_dtor(return_value);
@@ -3121,14 +3121,14 @@ PHP_FUNCTION(imap_bodystruct)
if (body->encoding <= ENCMAX) {
add_property_long(return_value, "encoding", body->encoding);
}
-
+
if (body->subtype) {
add_property_long(return_value, "ifsubtype", 1);
add_property_string(return_value, "subtype", body->subtype, 1);
} else {
add_property_long(return_value, "ifsubtype", 0);
}
-
+
if (body->description) {
add_property_long(return_value, "ifdescription", 1);
add_property_string(return_value, "description", body->description, 1);
@@ -3142,7 +3142,7 @@ PHP_FUNCTION(imap_bodystruct)
add_property_long(return_value, "ifid", 0);
}
-
+
if (body->size.lines) {
add_property_long(return_value, "lines", body->size.lines);
}
@@ -3156,7 +3156,7 @@ PHP_FUNCTION(imap_bodystruct)
} else {
add_property_long(return_value, "ifdisposition", 0);
}
-
+
if (body->disposition.parameter) {
dpar = body->disposition.parameter;
add_property_long(return_value, "ifdparameters", 1);
@@ -3174,10 +3174,10 @@ PHP_FUNCTION(imap_bodystruct)
add_property_long(return_value, "ifdparameters", 0);
}
#endif
-
+
if ((par = body->parameter)) {
add_property_long(return_value, "ifparameters", 1);
-
+
MAKE_STD_ZVAL(parametres);
array_init(parametres);
do {
@@ -3189,7 +3189,7 @@ PHP_FUNCTION(imap_bodystruct)
if (par->value) {
add_property_string(param, "value", par->value, 1);
}
-
+
add_next_index_object(parametres, param TSRMLS_CC);
} while ((par = par->next));
} else {
@@ -3203,7 +3203,7 @@ PHP_FUNCTION(imap_bodystruct)
/* }}} */
/* {{{ proto array imap_fetch_overview(resource stream_id, string sequence [, int options])
- Read an overview of the information in the headers of the given message sequence */
+ Read an overview of the information in the headers of the given message sequence */
PHP_FUNCTION(imap_fetch_overview)
{
zval *streamind;
@@ -3231,12 +3231,12 @@ PHP_FUNCTION(imap_fetch_overview)
status = (flags & FT_UID)
? mail_uid_sequence(imap_le_struct->imap_stream, sequence)
: mail_sequence(imap_le_struct->imap_stream, sequence);
-
- if (status) {
+
+ if (status) {
MESSAGECACHE *elt;
ENVELOPE *env;
unsigned long i;
-
+
for (i = 1; i <= imap_le_struct->imap_stream->nmsgs; i++) {
if (((elt = mail_elt (imap_le_struct->imap_stream, i))->sequence) &&
(env = mail_fetch_structure (imap_le_struct->imap_stream, i, NIL, NIL))) {
@@ -3498,7 +3498,7 @@ PHP_FUNCTION(imap_mail_compose)
if (type != TYPEMULTIPART) {
bod->type = type;
- }
+ }
if (zend_hash_find(Z_ARRVAL_PP(data), "encoding", sizeof("encoding"), (void **) &pvalue)== SUCCESS) {
convert_to_long_ex(pvalue);
@@ -3532,7 +3532,7 @@ PHP_FUNCTION(imap_mail_compose)
}
if (zend_hash_find(Z_ARRVAL_PP(data), "subtype", sizeof("subtype"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
- bod->subtype = cpystr(Z_STRVAL_PP(pvalue));
+ bod->subtype = cpystr(Z_STRVAL_PP(pvalue));
}
if (zend_hash_find(Z_ARRVAL_PP(data), "id", sizeof("id"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
@@ -3611,7 +3611,7 @@ PHP_FUNCTION(imap_mail_compose)
tmp[l] = '\0';
tempstring = emalloc(l);
memcpy(tempstring, tmp, l);
-
+
do {
l2 = strlen(custom_headers_param->value);
tempstring = erealloc(tempstring, l + l2 + CRLF_LEN + 1);
@@ -3620,7 +3620,7 @@ PHP_FUNCTION(imap_mail_compose)
l += l2 + CRLF_LEN;
} while ((custom_headers_param = custom_headers_param->next));
- mail_free_body_parameter(&tp);
+ mail_free_body_parameter(&tp);
mystring = emalloc(l + CRLF_LEN + 1);
memcpy(mystring, tempstring, l);
@@ -3634,10 +3634,10 @@ PHP_FUNCTION(imap_mail_compose)
bod = topbod;
- if (bod && bod->type == TYPEMULTIPART) {
+ if (bod && bod->type == TYPEMULTIPART) {
/* first body part */
- part = bod->nested.part;
+ part = bod->nested.part;
/* find cookie */
for (param = bod->parameter; param && !cookie; param = param->next) {
@@ -3648,17 +3648,17 @@ PHP_FUNCTION(imap_mail_compose)
/* yucky default */
if (!cookie) {
- cookie = "-";
+ cookie = "-";
} else if (strlen(cookie) > (SENDBUFLEN - 2 - 2 - 2)) { /* validate cookie length -- + CRLF * 2 */
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The boudary should be no longer then 4kb");
RETVAL_FALSE;
- goto done;
+ goto done;
}
/* for each part */
do {
t = tmp;
-
+
/* append mini-header */
*t = '\0';
rfc822_write_body_header(&t, &part->body);
@@ -3923,7 +3923,7 @@ PHP_FUNCTION(imap_search)
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
search_criteria = estrndup(criteria, criteria_len);
-
+
IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL;
pgm = mail_criteria(search_criteria);
@@ -3937,7 +3937,7 @@ PHP_FUNCTION(imap_search)
efree(search_criteria);
RETURN_FALSE;
}
-
+
array_init(return_value);
cur = IMAPG(imap_messages);
@@ -3959,12 +3959,12 @@ PHP_FUNCTION(imap_alerts)
if (zend_parse_parameters_none() == FAILURE) {
return;
- }
-
+ }
+
if (IMAPG(imap_alertstack) == NIL) {
RETURN_FALSE;
}
-
+
array_init(return_value);
cur = IMAPG(imap_alertstack);
@@ -3986,12 +3986,12 @@ PHP_FUNCTION(imap_errors)
if (zend_parse_parameters_none() == FAILURE) {
return;
- }
-
+ }
+
if (IMAPG(imap_errorstack) == NIL) {
RETURN_FALSE;
}
-
+
array_init(return_value);
cur = IMAPG(imap_errorstack);
@@ -4004,7 +4004,7 @@ PHP_FUNCTION(imap_errors)
}
/* }}} */
-/* {{{ proto string imap_last_error(void)
+/* {{{ proto string imap_last_error(void)
Returns the last error that was generated by an IMAP function. The error stack is NOT cleared after this call. */
/* Author: CJH */
PHP_FUNCTION(imap_last_error)
@@ -4013,12 +4013,12 @@ PHP_FUNCTION(imap_last_error)
if (zend_parse_parameters_none() == FAILURE) {
return;
- }
-
+ }
+
if (IMAPG(imap_errorstack) == NIL) {
RETURN_FALSE;
}
-
+
cur = IMAPG(imap_errorstack);
while (cur != NIL) {
if (cur->next == NIL) {
@@ -4048,7 +4048,7 @@ PHP_FUNCTION(imap_mime_header_decode)
string = str;
end = str_len;
-
+
charset = (char *) safe_emalloc((end + 1), 2, 0);
text = &charset[end + 1];
while (offset < end) { /* Reached end of the string? */
@@ -4120,7 +4120,7 @@ PHP_FUNCTION(imap_mime_header_decode)
add_property_string(myobject, "charset", "default", 1);
add_property_string(myobject, "text", text, 1);
zend_hash_next_index_insert(Z_ARRVAL_P(return_value), (void *)&myobject, sizeof(zval *), NULL);
-
+
offset = end; /* We have reached the end of the string. */
}
efree(charset);
@@ -4138,7 +4138,7 @@ static long _php_rfc822_soutr (void *stream, char *string)
smart_str *ret = (smart_str*)stream;
int len = strlen(string);
- smart_str_appendl(ret, string, len);
+ smart_str_appendl(ret, string, len);
return LONGT;
}
@@ -4168,7 +4168,7 @@ static char* _php_rfc822_write_address(ADDRESS *addresslist TSRMLS_DC)
/* {{{ _php_rfc822_len
* Calculate string length based on imap's rfc822_cat function.
- */
+ */
static int _php_rfc822_len(char *str)
{
int len;
@@ -4212,8 +4212,8 @@ static int _php_imap_address_size (ADDRESS *addresslist)
num_ent++;
} while ((tmp = tmp->next));
- /*
- * rfc822_write_address_full() needs some extra space for '<>,', etc.
+ /*
+ * rfc822_write_address_full() needs some extra space for '<>,', etc.
* for this perpouse we allocate additional PHP_IMAP_ADDRESS_SIZE_BUF bytes
* by default this buffer is 10 bytes long
*/
@@ -4247,11 +4247,11 @@ static char* _php_imap_parse_address (ADDRESS *addresslist, zval *paddress TSRML
char *fulladdress;
ADDRESS *addresstmp;
zval *tmpvals;
-
+
addresstmp = addresslist;
fulladdress = _php_rfc822_write_address(addresstmp TSRMLS_CC);
-
+
addresstmp = addresslist;
do {
MAKE_STD_ZVAL(tmpvals);
@@ -4272,9 +4272,9 @@ static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC)
{
zval *paddress;
char *fulladdress=NULL;
-
+
object_init(myzvalue);
-
+
if (en->remail) add_property_string(myzvalue, "remail", en->remail, 1);
if (en->date) add_property_string(myzvalue, "date", en->date, 1);
if (en->date) add_property_string(myzvalue, "Date", en->date, 1);
@@ -4285,7 +4285,7 @@ static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC)
if (en->newsgroups) add_property_string(myzvalue, "newsgroups", en->newsgroups, 1);
if (en->followup_to) add_property_string(myzvalue, "followup_to", en->followup_to, 1);
if (en->references) add_property_string(myzvalue, "references", en->references, 1);
-
+
if (en->to) {
MAKE_STD_ZVAL(paddress);
array_init(paddress);
@@ -4295,7 +4295,7 @@ static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC)
}
add_assoc_object(myzvalue, "to", paddress TSRMLS_CC);
}
-
+
if (en->from) {
MAKE_STD_ZVAL(paddress);
array_init(paddress);
@@ -4305,7 +4305,7 @@ static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC)
}
add_assoc_object(myzvalue, "from", paddress TSRMLS_CC);
}
-
+
if (en->cc) {
MAKE_STD_ZVAL(paddress);
array_init(paddress);
@@ -4315,7 +4315,7 @@ static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC)
}
add_assoc_object(myzvalue, "cc", paddress TSRMLS_CC);
}
-
+
if (en->bcc) {
MAKE_STD_ZVAL(paddress);
array_init(paddress);
@@ -4325,7 +4325,7 @@ static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC)
}
add_assoc_object(myzvalue, "bcc", paddress TSRMLS_CC);
}
-
+
if (en->reply_to) {
MAKE_STD_ZVAL(paddress);
array_init(paddress);
@@ -4365,7 +4365,7 @@ void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
zval *parametres, *param, *dparametres, *dparam;
PARAMETER *par, *dpar;
PART *part;
-
+
if (body->type <= TYPEMAX) {
add_property_long(arg, "type", body->type);
}
@@ -4394,7 +4394,7 @@ void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
} else {
add_property_long(arg, "ifid", 0);
}
-
+
if (body->size.lines) {
add_property_long(arg, "lines", body->size.lines);
}
@@ -4428,7 +4428,7 @@ void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
add_property_long(arg, "ifdparameters", 0);
}
#endif
-
+
if ((par = body->parameter)) {
add_property_long(arg, "ifparameters", 1);
@@ -4465,7 +4465,7 @@ void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
}
add_assoc_object(arg, "parts", parametres TSRMLS_CC);
}
-
+
/* encapsulated message ? */
if ((body->type == TYPEMESSAGE) && (!strcasecmp(body->subtype, "rfc822"))) {
body = body->CONTENT_MSG_BODY;
@@ -4506,14 +4506,14 @@ static void build_thread_tree_helper(THREADNODE *cur, zval *tree, long *numNodes
if(cur->branch) {
(*numNodes)++;
add_assoc_long(tree, buf, *numNodes);
- build_thread_tree_helper(cur->branch, tree, numNodes, buf);
+ build_thread_tree_helper(cur->branch, tree, numNodes, buf);
} else { /* "null pointer" */
add_assoc_long(tree, buf, 0);
}
}
/* }}} */
-/* {{{ build_thread_tree
+/* {{{ build_thread_tree
*/
static int build_thread_tree(THREADNODE *top, zval **tree)
{
@@ -4521,7 +4521,7 @@ static int build_thread_tree(THREADNODE *top, zval **tree)
char buf[25];
array_init(*tree);
-
+
build_thread_tree_helper(top, *tree, &numNodes, buf);
return SUCCESS;
@@ -4543,9 +4543,9 @@ PHP_FUNCTION(imap_thread)
if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &streamind, &flags) == FAILURE) {
return;
}
-
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, &streamind, -1, "imap", le_imap);
-
+
pgm = mail_criteria(criteria);
top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, pgm, flags);
if (pgm) {
@@ -4630,15 +4630,15 @@ PHP_FUNCTION(imap_timeout)
static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DATA *md)
{
TSRMLS_FETCH();
-
- /* write to the gets stream if it is set,
+
+ /* write to the gets stream if it is set,
otherwise forward to c-clients gets */
if (IMAPG(gets_stream)) {
char buf[GETS_FETCH_SIZE];
-
+
while (size) {
unsigned long read;
-
+
if (size > GETS_FETCH_SIZE) {
read = GETS_FETCH_SIZE;
size -=GETS_FETCH_SIZE;
@@ -4646,7 +4646,7 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
read = size;
size = 0;
}
-
+
if (!f(stream, read, buf)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to read from socket");
break;
@@ -4658,7 +4658,7 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
return NULL;
} else {
char *buf = pemalloc(size + 1, 1);
-
+
if (f(stream, size, buf)) {
buf[size] = '\0';
} else {
@@ -4671,7 +4671,7 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
}
/* }}} */
-/* {{{ Interfaces to C-client
+/* {{{ Interfaces to C-client
*/
PHP_IMAP_EXPORT void mm_searched(MAILSTREAM *stream, unsigned long number)
{
@@ -4710,12 +4710,12 @@ PHP_IMAP_EXPORT void mm_notify(MAILSTREAM *stream, char *str, long errflg)
{
STRINGLIST *cur = NIL;
TSRMLS_FETCH();
-
+
if (strncmp(str, "[ALERT] ", 8) == 0) {
if (IMAPG(imap_alertstack) == NIL) {
IMAPG(imap_alertstack) = mail_newstringlist();
IMAPG(imap_alertstack)->LSIZE = strlen(IMAPG(imap_alertstack)->LTEXT = cpystr(str));
- IMAPG(imap_alertstack)->next = NIL;
+ IMAPG(imap_alertstack)->next = NIL;
} else {
cur = IMAPG(imap_alertstack);
while (cur->next != NIL) {
@@ -4734,7 +4734,7 @@ PHP_IMAP_EXPORT void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox,
STRINGLIST *cur=NIL;
FOBJECTLIST *ocur=NIL;
TSRMLS_FETCH();
-
+
if (IMAPG(folderlist_style) == FLIST_OBJECT) {
/* build up a the new array of objects */
/* Author: CJH */
@@ -4755,14 +4755,14 @@ PHP_IMAP_EXPORT void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox,
ocur->next = NIL;
IMAPG(imap_folder_objects_tail) = ocur;
}
-
+
} else {
/* build the old IMAPG(imap_folders) variable to allow old imap_listmailbox() to work */
if (!(attributes & LATT_NOSELECT)) {
if (IMAPG(imap_folders) == NIL) {
IMAPG(imap_folders)=mail_newstringlist();
IMAPG(imap_folders)->LSIZE=strlen(IMAPG(imap_folders)->LTEXT=cpystr(mailbox));
- IMAPG(imap_folders)->next=NIL;
+ IMAPG(imap_folders)->next=NIL;
IMAPG(imap_folders_tail) = IMAPG(imap_folders);
} else {
cur=IMAPG(imap_folders_tail);
@@ -4781,7 +4781,7 @@ PHP_IMAP_EXPORT void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox,
STRINGLIST *cur=NIL;
FOBJECTLIST *ocur=NIL;
TSRMLS_FETCH();
-
+
if (IMAPG(folderlist_style) == FLIST_OBJECT) {
/* build the array of objects */
/* Author: CJH */
@@ -4807,7 +4807,7 @@ PHP_IMAP_EXPORT void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox,
if (IMAPG(imap_sfolders) == NIL) {
IMAPG(imap_sfolders)=mail_newstringlist();
IMAPG(imap_sfolders)->LSIZE=strlen(IMAPG(imap_sfolders)->LTEXT=cpystr(mailbox));
- IMAPG(imap_sfolders)->next=NIL;
+ IMAPG(imap_sfolders)->next=NIL;
IMAPG(imap_sfolders_tail) = IMAPG(imap_sfolders);
} else {
cur=IMAPG(imap_sfolders_tail);
@@ -4846,14 +4846,14 @@ PHP_IMAP_EXPORT void mm_log(char *str, long errflg)
{
ERRORLIST *cur = NIL;
TSRMLS_FETCH();
-
+
/* Author: CJH */
if (errflg != NIL) { /* CJH: maybe put these into a more comprehensive log for debugging purposes? */
if (IMAPG(imap_errorstack) == NIL) {
IMAPG(imap_errorstack) = mail_newerrorlist();
IMAPG(imap_errorstack)->LSIZE = strlen(IMAPG(imap_errorstack)->LTEXT = cpystr(str));
IMAPG(imap_errorstack)->errflg = errflg;
- IMAPG(imap_errorstack)->next = NIL;
+ IMAPG(imap_errorstack)->next = NIL;
} else {
cur = IMAPG(imap_errorstack);
while (cur->next != NIL) {