}
}
-static inline void php_http_querystring_get(zval *instance, int type, char *name, uint name_len, zval *defval, zend_bool del, zval *return_value)
+static inline void php_http_querystring_get(zval *instance, int type, char *name, uint32_t name_len, zval *defval, zend_bool del, zval *return_value)
{
zval *arrval, qarray_tmp, *qarray = zend_read_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), 0, &qarray_tmp);
zval *entry;
zend_string *xkey, *xstr;
php_http_arrkey_t key;
-
+
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(src), key.h, key.key, entry)
{
if (key.key) {
return FAILURE;
}
}
-
+
if (Z_TYPE_P(entry) == IS_STRING) {
if (PHP_ICONV_ERR_SUCCESS != php_iconv_string(Z_STRVAL_P(entry), Z_STRLEN_P(entry), &xstr, oe, ie)) {
if (key.key) {
}
} else if (Z_TYPE_P(entry) == IS_ARRAY) {
zval subarray;
-
+
array_init(&subarray);
if (key.key) {
add_assoc_zval_ex(dst, xkey->val, xkey->len, &subarray);
return FAILURE;
}
}
-
+
if (key.key) {
zend_string_release(xkey);
}
{
zval *params = NULL;
zend_error_handling zeh;
-
+
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|z", ¶ms), invalid_arg, return);
zend_replace_error_handling(EH_THROW, php_http_get_exception_bad_querystring_class_entry(), &zeh);
ZVAL_STRING(&tmp, "queryArray");
qa = Z_OBJ_HT_P(return_value)->get_property_ptr_ptr(return_value, &tmp, BP_VAR_RW, NULL);
- ZVAL_NEW_REF(qa, _GET);
zval_ptr_dtor(&tmp);
+ ZVAL_NEW_REF(_GET, _GET);
+ ZVAL_COPY(qa, _GET);
+
zend_update_static_property(php_http_querystring_class_entry, ZEND_STRL("instance"), return_value);
} else {
php_http_throw(unexpected_val, "Could not acquire reference to superglobal GET array");
zend_long type = 0;
zend_bool del = 0;
zval *ztype = NULL, *defval = NULL;
-
+
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|szzb", &name_str, &name_len, &ztype, &defval, &del)) {
if (name_str && name_len) {
if (ztype) {
type = Z_LVAL_P(ztype);
} else if(Z_TYPE_P(ztype) == IS_STRING) {
switch (Z_STRVAL_P(ztype)[0]) {
- case 'B':
+ case 'B':
case 'b': type = PHP_HTTP_QUERYSTRING_TYPE_BOOL; break;
case 'L':
case 'l':
case 'd':
case 'D':
case 'F':
- case 'f': type = PHP_HTTP_QUERYSTRING_TYPE_FLOAT; break;
+ case 'f': type = PHP_HTTP_QUERYSTRING_TYPE_FLOAT; break;
case 'S':
case 's': type = PHP_HTTP_QUERYSTRING_TYPE_STRING; break;
case 'A':
PHP_METHOD(HttpQueryString, set)
{
zval *params;
-
+
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "z", ¶ms)) {
return;
}
-
+
php_http_querystring_set(getThis(), params, QS_MERGE);
RETVAL_ZVAL(getThis(), 1, 0);
}
zend_error_handling zeh;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "z", ¶ms), invalid_arg, return);
-
+
zend_replace_error_handling(EH_THROW, php_http_get_exception_bad_querystring_class_entry(), &zeh);
ZVAL_OBJ(return_value, Z_OBJ_HT_P(instance)->clone_obj(instance));
/* make sure we do not inherit the reference to _GET */
php_http_querystring_set(getThis(), &na, 0);
RETVAL_ZVAL(getThis(), 1, 0);
-
+
zval_ptr_dtor(&na);
}
#endif /* HAVE_ICONV */
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S", &offset)) {
return;
}
-
qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0, &qa_tmp);
+
ZVAL_DEREF(qa);
if (Z_TYPE_P(qa) == IS_ARRAY) {
{
zend_string *offset;
zval *value, param, znull;
-
+
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &offset, &value)) {
return;
}
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S", &offset)) {
return;
}
-
qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0, &qa_tmp);
+
ZVAL_DEREF(qa);
if (Z_TYPE_P(qa) == IS_ARRAY) {
{
zend_string *offset;
zval param, znull;
-
+
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S", &offset)) {
return;
}