diff options
author | Xinchen Hui <laruence@php.net> | 2014-05-05 19:45:50 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2014-05-05 19:45:50 +0800 |
commit | fa6f6c880741ae9696a9c21707fd3a844dd8d5ee (patch) | |
tree | 40b54c2f6d3d85c3aed1b1d76f7c92fca0a196d6 | |
parent | c73c6526ef4d61881f53f5914398f58a35d1c62f (diff) | |
download | php-git-fa6f6c880741ae9696a9c21707fd3a844dd8d5ee.tar.gz |
Fixed Reference handling in xml_parse_into_struct
-rw-r--r-- | ext/json/json.c | 3 | ||||
-rw-r--r-- | ext/xml/xml.c | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/ext/json/json.c b/ext/json/json.c index 528764e17c..7760741125 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -380,7 +380,6 @@ static int json_utf8_to_utf16(unsigned short *utf16, char utf8[], int len) /* {{ } /* }}} */ - static void json_escape_string(smart_str *buf, char *s, int len, int options TSRMLS_DC) /* {{{ */ { int pos = 0, ulen = 0; @@ -538,7 +537,6 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR } /* }}} */ - static void json_encode_serializable_object(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */ { zend_class_entry *ce = Z_OBJCE_P(val); @@ -754,7 +752,6 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, } /* }}} */ - /* {{{ proto string json_encode(mixed data [, int options[, int depth]]) Returns the JSON representation of a value */ static PHP_FUNCTION(json_encode) diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 146ff004f7..169be95981 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -679,7 +679,7 @@ static void _xml_add_to_info(xml_parser *parser,char *name) return; } - if ((element = zend_hash_str_find(Z_ARRVAL(parser->info),name, strlen(name))) == NULL) { + if ((element = zend_hash_str_find(Z_ARRVAL(parser->info), name, strlen(name))) == NULL) { zval values; array_init(&values); element = zend_hash_str_update(Z_ARRVAL(parser->info), name, strlen(name), &values); @@ -1407,8 +1407,9 @@ PHP_FUNCTION(xml_parse_into_struct) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz|z", &pind, &data, &data_len, &xdata, &info) == FAILURE) { return; } - + if (info) { + ZVAL_DEREF(info); zval_ptr_dtor(info); array_init(info); } |