X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_headers.c;h=226c763472253b7ad5cf77daf4d9919a17bc8a34;hb=c52a84fd06e87bf72eb98e83abfff29779b0681c;hp=a2e59de13f6872a7379389161ebf17cf0022c16e;hpb=abbb42df325117e48521ab7f71b37c5338d20252;p=m6w6%2Fext-http diff --git a/php_http_headers.c b/php_http_headers.c index a2e59de..226c763 100644 --- a/php_http_headers.c +++ b/php_http_headers.c @@ -10,9 +10,7 @@ +--------------------------------------------------------------------+ */ -#include "php_http.h" - -#include +#include "php_http_api.h" PHP_HTTP_API STATUS php_http_headers_parse(const char *header, size_t length, HashTable *headers, php_http_info_callback_t callback_func, void **callback_data TSRMLS_DC) { @@ -118,7 +116,7 @@ PHP_METHOD(HttpHeader, unserialize) zend_hash_internal_pointer_reset(&ht); switch (zend_hash_get_current_key_ex(&ht, &str, &len, &idx, 0, NULL)) { case HASH_KEY_IS_STRING: - zend_update_property_stringl(php_http_header_class_entry, getThis(), ZEND_STRL("name"), str, len TSRMLS_CC); + zend_update_property_stringl(php_http_header_class_entry, getThis(), ZEND_STRL("name"), str, len - 1 TSRMLS_CC); break; case HASH_KEY_IS_LONG: zend_update_property_long(php_http_header_class_entry, getThis(), ZEND_STRL("name"), idx TSRMLS_CC); @@ -149,7 +147,8 @@ PHP_METHOD(HttpHeader, match) } zvalue = php_http_ztyp(IS_STRING, zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0 TSRMLS_CC)); - RETURN_BOOL(php_http_match(Z_STRVAL_P(zvalue), val_str, flags)) + RETVAL_BOOL(php_http_match(Z_STRVAL_P(zvalue), val_str, flags)); + zval_ptr_dtor(&zvalue); } PHP_MINIT_FUNCTION(http_header)