- if (key.type == HASH_KEY_IS_STRING && key.len) {
- append_encoded(&buf, key.str, key.len-1, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
- } else if (key.type == HASH_KEY_IS_LONG) {
- int enc_len;
- char *enc_str = php_raw_url_encode(Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), &enc_len);
-
- php_http_buffer_appendf(&buf, "%ld=%.*s; ", key.num, enc_len, enc_str);
- efree(enc_str);
- }
+
+ php_http_array_hashkey_stringify(&key);
+ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
+ php_http_array_hashkey_stringfree(&key);
+