From: Michael Wallner Date: Sat, 7 Oct 2006 12:45:10 +0000 (+0000) Subject: - don't raise notice when checking If-Range header for a last modification date X-Git-Tag: RELEASE_1_3_2~7 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=3d3fa591d770c2b046ff8f51e85bd8dafc1dfa56;p=m6w6%2Fext-http - don't raise notice when checking If-Range header for a last modification date --- diff --git a/http_cache_api.c b/http_cache_api.c index 9a6ea89..adba374 100644 --- a/http_cache_api.c +++ b/http_cache_api.c @@ -85,7 +85,7 @@ PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t, chr_ptr = 0; } - retval = (t <= http_parse_date(modified)); + retval = (t <= http_parse_date_ex(modified, 1)); efree(modified); return retval; } diff --git a/http_date_api.c b/http_date_api.c index 10f3463..32efdfb 100644 --- a/http_date_api.c +++ b/http_date_api.c @@ -159,7 +159,7 @@ PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC) /* }}} */ /* {{{ time_t http_parse_date(char *) */ -PHP_HTTP_API time_t _http_parse_date(const char *date TSRMLS_DC) +PHP_HTTP_API time_t _http_parse_date_ex(const char *date, zend_bool silent TSRMLS_DC) { time_t t = -1; @@ -180,7 +180,7 @@ PHP_HTTP_API time_t _http_parse_date(const char *date TSRMLS_DC) putenv(tzput); #endif - if (-1 == t) { + if (-1 == t && !silent) { http_error_ex(HE_NOTICE, HTTP_E_RUNTIME, "Could not parse date: %s", date); } diff --git a/php_http_date_api.h b/php_http_date_api.h index 3356e38..948f6e8 100644 --- a/php_http_date_api.h +++ b/php_http_date_api.h @@ -18,8 +18,9 @@ #define http_date(t) _http_date((t) TSRMLS_CC) PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC); -#define http_parse_date(d) _http_parse_date((d) TSRMLS_CC) -PHP_HTTP_API time_t _http_parse_date(const char *date TSRMLS_DC); +#define http_parse_date(d) _http_parse_date_ex((d), 0 TSRMLS_CC) +#define http_parse_date_ex(d, s) _http_parse_date_ex((d), (s) TSRMLS_CC) +PHP_HTTP_API time_t _http_parse_date_ex(const char *date, zend_bool silent TSRMLS_DC); #endif