X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_headers_api.c;fp=http_headers_api.c;h=4e65b1d25f861ce1f0170f1b628d5b9bd53101e8;hp=7bbe8e921d4bef6d6b34b1e99239ca658e26f0a6;hb=0e998acc9b529b67de3b1a772e016dd85bbc8eb2;hpb=833996197be90565b5bf497aa28226ddf10fb575 diff --git a/http_headers_api.c b/http_headers_api.c index 7bbe8e9..4e65b1d 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -466,13 +466,14 @@ PHP_HTTP_API zend_bool _http_match_request_header_ex(const char *header, const c char *name; uint name_len = strlen(header); zend_bool result = 0; - zval **data; + zval **data, *zvalue; http_get_request_headers(NULL); name = pretty_key(estrndup(header, name_len), name_len, 1, 1); if (SUCCESS == zend_hash_find(HTTP_G->request.headers, name, name_len+1, (void *) &data)) { - convert_to_string_ex(data); - result = (match_case ? strcmp(Z_STRVAL_PP(data), value) : strcasecmp(Z_STRVAL_PP(data), value)) ? 0 : 1; + zvalue = zval_copy(IS_STRING, *data); + result = (match_case ? strcmp(Z_STRVAL_P(zvalue), value) : strcasecmp(Z_STRVAL_P(zvalue), value)) ? 0 : 1; + zval_free(&zvalue); } efree(name);