summaryrefslogtreecommitdiff
path: root/ext/standard/http.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2014-02-18 17:42:46 +0800
committerXinchen Hui <laruence@gmail.com>2014-02-18 17:42:46 +0800
commit43b03c74b322d6ceb003a14a7561fdffc4e13072 (patch)
treee5cf8ec9939d559fc7f6aaedb89404d2312561cc /ext/standard/http.c
parent1c4f3d39a805323dc60f2bc1bfc96e39d608ac37 (diff)
downloadphp-git-43b03c74b322d6ceb003a14a7561fdffc4e13072.tar.gz
Refacting smart_str
Diffstat (limited to 'ext/standard/http.c')
-rw-r--r--ext/standard/http.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/standard/http.c b/ext/standard/http.c
index 4d6762dc12..5fe9112076 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -141,7 +141,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
/* Skip these types */
continue;
} else {
- if (formstr->len) {
+ if (formstr->s->len) {
smart_str_appendl(formstr, arg_sep, arg_sep_len);
}
/* Simple key=value */
@@ -220,20 +220,19 @@ PHP_FUNCTION(http_build_query)
}
if (php_url_encode_hash_ex(HASH_OF(formdata), &formstr, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL), arg_sep, enc_type TSRMLS_CC) == FAILURE) {
- if (formstr.c) {
- efree(formstr.c);
+ if (formstr.s) {
+ smart_str_free(&formstr);
}
RETURN_FALSE;
}
- if (!formstr.c) {
+ if (!formstr.s) {
RETURN_EMPTY_STRING();
}
smart_str_0(&formstr);
-//??? RETURN_STRINGL(formstr.c, formstr.len, 0);
- RETURN_STRINGL(formstr.c, formstr.len);
+ RETURN_STR(formstr.s);
}
/* }}} */