From: Michael Wallner Date: Sat, 19 Nov 2005 17:02:48 +0000 (+0000) Subject: - aliases for HttpUtil X-Git-Tag: RELEASE_0_19_0~10 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=1ad65c598ee022aa7b31bb0884fe15b3dcd454d3;p=m6w6%2Fext-http - aliases for HttpUtil - check ident_len of identifier --- diff --git a/http_headers_api.c b/http_headers_api.c index 3cb9c91..e8cfd69 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -179,7 +179,7 @@ PHP_HTTP_API HashTable *_http_negotiate_q(const char *header, HashTable *support ++identifier; --ident_len; } - while (isspace(identifier[ident_len - 1])) { + while (ident_len && isspace(identifier[ident_len - 1])) { identifier[--ident_len] = '\0'; } diff --git a/http_util_object.c b/http_util_object.c index ce9a705..2a8b469 100644 --- a/http_util_object.c +++ b/http_util_object.c @@ -50,6 +50,11 @@ HTTP_BEGIN_ARGS(negotiateCharset, 1) HTTP_ARG_VAL(result, 1) HTTP_END_ARGS; +HTTP_BEGIN_ARGS(negotiateContentType, 1) + HTTP_ARG_VAL(supported, 0) + HTTP_ARG_VAL(result, 1) +HTTP_END_ARGS; + HTTP_BEGIN_ARGS(matchModified, 1) HTTP_ARG_VAL(last_modified, 0) HTTP_ARG_VAL(for_range, 0) @@ -115,6 +120,7 @@ zend_function_entry http_util_object_fe[] = { HTTP_UTIL_ALIAS(buildUri, http_build_uri) HTTP_UTIL_ALIAS(negotiateLanguage, http_negotiate_language) HTTP_UTIL_ALIAS(negotiateCharset, http_negotiate_charset) + HTTP_UTIL_ALIAS(negotiateContentType, http_negotiate_content_type) HTTP_UTIL_ALIAS(matchModified, http_match_modified) HTTP_UTIL_ALIAS(matchEtag, http_match_etag) HTTP_UTIL_ALIAS(matchRequestHeader, http_match_request_header) diff --git a/php_http_util_object.h b/php_http_util_object.h index b758a34..29d2454 100644 --- a/php_http_util_object.h +++ b/php_http_util_object.h @@ -25,6 +25,7 @@ PHP_METHOD(HttpUtil, date); PHP_METHOD(HttpUtil, absoluteUri); PHP_METHOD(HttpUtil, negotiateLanguage); PHP_METHOD(HttpUtil, negotiateCharset); +PHP_METHOD(HttpUtil, negotiateContentType); PHP_METHOD(HttpUtil, matchModified); PHP_METHOD(HttpUtil, matchEtag); PHP_METHOD(HttpUtil, parseHeaders);