- here goes the same with cookies
authorMichael Wallner <mike@php.net>
Thu, 22 Dec 2005 16:33:29 +0000 (16:33 +0000)
committerMichael Wallner <mike@php.net>
Thu, 22 Dec 2005 16:33:29 +0000 (16:33 +0000)
http_request_api.c

index 260b1f4a89fa065f02a674fc0bf2c4e11d9ffbeb..a61dc36a359453a591c7220cc7b09fa8937ba6f3 100644 (file)
@@ -505,13 +505,16 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti
                        if (cookie_key) {
                                zval **cookie_val;
                                if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(zoption), (void **) &cookie_val, &pos)) {
-                                       zval *cpy, *val = convert_to_type_ex(IS_STRING, *cookie_val, &cpy);
+                                       zval val;
+                                       
+                                       val = **cookie_val;
+                                       INIT_PZVAL(&val);
+                                       zval_copy_ctor(&val);
+                                       convert_to_string(&val);
                                        
                                        phpstr_appendf(&request->_cache.cookies, "%s=%s; ", cookie_key, Z_STRVAL_P(val));
                                        
-                                       if (cpy) {
-                                               zval_ptr_dtor(&cpy);
-                                       }
+                                       zval_dtor(&val);
                                }
 
                                /* reset */