- aliases for HttpUtil
authorMichael Wallner <mike@php.net>
Sat, 19 Nov 2005 17:02:48 +0000 (17:02 +0000)
committerMichael Wallner <mike@php.net>
Sat, 19 Nov 2005 17:02:48 +0000 (17:02 +0000)
- check ident_len of identifier

http_headers_api.c
http_util_object.c
php_http_util_object.h

index 3cb9c9128626e48c4912c4deb665cd352c19f6b5..e8cfd6964000fe2381c13010a4f077fccb6de48f 100644 (file)
@@ -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';
                                }
                                
index ce9a7058a64241869df9f4d8ceb2aa03bc62516b..2a8b469e346c092d1578bbb1828bac832632f5a0 100644 (file)
@@ -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)
index b758a345c0294fd000b6260ad2b6bc34dd25b89f..29d2454d7ae744e3b09b3c17afe12a4691f47de4 100644 (file)
@@ -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);