From: Hartmut Holzgraefe Date: Sat, 11 Nov 2000 10:15:59 +0000 (+0000) Subject: fix for #7756 and #6743 : fatal error on 'include("")' instead of warning X-Git-Tag: php-4.0.4RC3~244 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38569740da486809ee5b1a309c82cb364397932a;p=php fix for #7756 and #6743 : fatal error on 'include("")' instead of warning (+ some cleanup) --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 48e567b9d2..752cd1ac5d 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -241,12 +241,13 @@ PHPAPI FILE *php_fopen_wrapper(char *path, char *mode, int options, int *issock, { PLS_FETCH(); + if(!path) return NULL; + if(!*path) return NULL; + if (opened_path) { *opened_path = NULL; } - /* FIXME Lets not get in the habit of doing stuff like this. This should - be runtime enabled, NOT compile time. */ if(PG(allow_url_fopen)) { if (!(options & IGNORE_URL)) { return php_fopen_url_wrapper(path, mode, options, issock, socketd, opened_path); @@ -477,12 +478,6 @@ static FILE *php_fopen_url_wrapper(const char *path, char *mode, int options, in return NULL; } -PHPAPI int php_is_url(char *path) -{ - return (!strncasecmp(path, "http://", 7) || !strncasecmp(path, "ftp://", 6)); -} - - PHPAPI char *php_strip_url_passwd(char *url) { register char *p = url, *url_start;