diff options
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r-- | ext/imap/php_imap.c | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index e1adcf2264..24b18212a3 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -26,7 +26,6 @@ | PHP 4.0 updates: Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id$ */ #define IMAP41 @@ -468,7 +467,7 @@ ZEND_END_ARG_INFO() /* {{{ imap_functions[] */ -const zend_function_entry imap_functions[] = { +static const zend_function_entry imap_functions[] = { PHP_FE(imap_open, arginfo_imap_open) PHP_FE(imap_reopen, arginfo_imap_reopen) PHP_FE(imap_close, arginfo_imap_close) @@ -1436,7 +1435,7 @@ PHP_FUNCTION(imap_get_quota) mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota); if (!imap_getquota(imap_le_struct->imap_stream, ZSTR_VAL(qroot))) { php_error_docref(NULL, E_WARNING, "c-client imap_getquota failed"); - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } } @@ -1465,7 +1464,7 @@ PHP_FUNCTION(imap_get_quotaroot) mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota); if (!imap_getquotaroot(imap_le_struct->imap_stream, ZSTR_VAL(mbox))) { php_error_docref(NULL, E_WARNING, "c-client imap_getquotaroot failed"); - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } } @@ -1542,7 +1541,7 @@ PHP_FUNCTION(imap_getacl) mail_parameters(NIL, SET_ACL, (void *) mail_getacl); if (!imap_getacl(imap_le_struct->imap_stream, ZSTR_VAL(mailbox))) { php_error(E_WARNING, "c-client imap_getacl failed"); - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } @@ -3339,7 +3338,7 @@ PHP_FUNCTION(imap_bodystruct) body=mail_body(imap_le_struct->imap_stream, msg, (unsigned char*)ZSTR_VAL(section)); if (body == NULL) { - zval_dtor(return_value); + zval_ptr_dtor(return_value); RETURN_FALSE; } if (body->type <= TYPEMAX) { @@ -3609,12 +3608,10 @@ PHP_FUNCTION(imap_mail_compose) topbod = bod; if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) { - convert_to_long_ex(pvalue); - bod->type = (short) Z_LVAL_P(pvalue); + bod->type = (short) zval_get_long(pvalue); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "encoding", sizeof("encoding") - 1)) != NULL) { - convert_to_long_ex(pvalue); - bod->encoding = (short) Z_LVAL_P(pvalue); + bod->encoding = (short) zval_get_long(pvalue); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "charset", sizeof("charset") - 1)) != NULL) { convert_to_string_ex(pvalue); @@ -3682,12 +3679,10 @@ PHP_FUNCTION(imap_mail_compose) bod->contents.text.size = 0; } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "lines", sizeof("lines") - 1)) != NULL) { - convert_to_long_ex(pvalue); - bod->size.lines = Z_LVAL_P(pvalue); + bod->size.lines = zval_get_long(pvalue); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "bytes", sizeof("bytes") - 1)) != NULL) { - convert_to_long_ex(pvalue); - bod->size.bytes = Z_LVAL_P(pvalue); + bod->size.bytes = zval_get_long(pvalue); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "md5", sizeof("md5") - 1)) != NULL) { convert_to_string_ex(pvalue); @@ -3696,8 +3691,7 @@ PHP_FUNCTION(imap_mail_compose) } else if (Z_TYPE_P(data) == IS_ARRAY) { short type = -1; if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) { - convert_to_long_ex(pvalue); - type = (short) Z_LVAL_P(pvalue); + type = (short) zval_get_long(pvalue); } if (!toppart) { @@ -3716,8 +3710,7 @@ PHP_FUNCTION(imap_mail_compose) } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "encoding", sizeof("encoding") - 1)) != NULL) { - convert_to_long_ex(pvalue); - bod->encoding = (short) Z_LVAL_P(pvalue); + bod->encoding = (short) zval_get_long(pvalue); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "charset", sizeof("charset") - 1)) != NULL) { convert_to_string_ex(pvalue); @@ -3786,12 +3779,10 @@ PHP_FUNCTION(imap_mail_compose) bod->contents.text.size = 0; } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "lines", sizeof("lines") - 1)) != NULL) { - convert_to_long_ex(pvalue); - bod->size.lines = Z_LVAL_P(pvalue); + bod->size.lines = zval_get_long(pvalue); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "bytes", sizeof("bytes") - 1)) != NULL) { - convert_to_long_ex(pvalue); - bod->size.bytes = Z_LVAL_P(pvalue); + bod->size.bytes = zval_get_long(pvalue); } if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "md5", sizeof("md5") - 1)) != NULL) { convert_to_string_ex(pvalue); @@ -4298,7 +4289,7 @@ PHP_FUNCTION(imap_mime_header_decode) } if (decode == NULL) { efree(charset); - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); RETURN_FALSE; } object_init(&myobject); |