summaryrefslogtreecommitdiff
path: root/ext/imap/php_imap.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-12-07 19:24:55 +0300
committerDmitry Stogov <dmitry@zend.com>2017-12-07 19:24:55 +0300
commit6a9d2b2190923bfbc7b7caa1462ba95965a1b991 (patch)
tree26d1695b07a29a873e5fcd74cd4af47c89454f78 /ext/imap/php_imap.c
parentc890d469fab27500f0fa1070dccb16b36aa8be76 (diff)
downloadphp-git-6a9d2b2190923bfbc7b7caa1462ba95965a1b991.tar.gz
Cleanup type conversion
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r--ext/imap/php_imap.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 17456e3df7..1dd4878d2f 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -3609,12 +3609,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 +3680,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 +3692,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 +3711,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 +3780,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);