X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_misc.c;h=e4411e0aaf39efb2e654e46913d8287ec0beb001;hp=4df85cfee6b3f421c9e53009bf5a64de502d6839;hb=14aec371d6123fbedbe13ca73b6a6d5768c635cb;hpb=29a54250b58e444974ae19840194e214cab80bd5 diff --git a/php_http_misc.c b/php_http_misc.c index 4df85cf..e4411e0 100644 --- a/php_http_misc.c +++ b/php_http_misc.c @@ -13,7 +13,6 @@ #include "php_http_api.h" #include -#include #include /* SLEEP */ @@ -51,6 +50,10 @@ int php_http_match(const char *haystack_str, const char *needle_str, int flags) { int result = 0; + if (!haystack_str || !needle_str) { + return result; + } + if (flags & PHP_HTTP_MATCH_FULL) { if (flags & PHP_HTTP_MATCH_CASE) { result = !strcmp(haystack_str, needle_str);