- Fixed build on php-trunk
[m6w6/ext-http] / http_querystring_api.c
index 4fc3986313bbd2e9a4272f952cf5239730efa486..7caa7bcf92ebca441d05f54417a792bd4a7656f1 100644 (file)
@@ -6,7 +6,7 @@
     | modification, are permitted provided that the conditions mentioned |
     | in the accompanying LICENSE file are met.                          |
     +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2007, Michael Wallner <mike@php.net>            |
+    | Copyright (c) 2004-2010, Michael Wallner <mike@php.net>            |
     +--------------------------------------------------------------------+
 */
 
@@ -161,6 +161,11 @@ static inline int _http_querystring_modify_array(zval *qarray, zval *params TSRM
 static inline int _http_querystring_modify_array_ex(zval *qarray, int key_type, char *key, int keylen, ulong idx, zval *params_entry TSRMLS_DC)
 {
        zval **qarray_entry;
+
+       /* ensure array type */
+       if (Z_TYPE_P(qarray) != IS_ARRAY) {
+               convert_to_array(qarray);
+       }
        
        /* delete */
        if (Z_TYPE_P(params_entry) == IS_NULL) {