From: Jani Taskinen Date: Sat, 25 Jul 2009 20:44:19 +0000 (+0000) Subject: - Fixed bug #48637 ("file" wrapper is overwritten when using --with-curlwrappers) X-Git-Tag: php-5.2.11RC1~102 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e1f000090f95ae8e86925fc28894f001c663c38;p=php - Fixed bug #48637 ("file" wrapper is overwritten when using --with-curlwrappers) # Also fixes bug #48603, basically same issue. --- diff --git a/NEWS b/NEWS index 64a2f34f4f..4b52774f13 100644 --- a/NEWS +++ b/NEWS @@ -29,6 +29,8 @@ PHP NEWS - Fixed bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted). (peter at lvp-media dot com, Felipe) - Fixed bug #48661 (phpize is broken with non-bash shells). (Jani) +- Fixed bug #48637 ("file" fopen wrapper is overwritten when using + --with-curlwrappers). (Jani) - Fixed bug #48636 (Error compiling of ext/date on netware). (guenter at php.net, Ilia) - Fixed bug #48629 (get_defined_constants() ignores categorize parameter). diff --git a/ext/curl/interface.c b/ext/curl/interface.c index a431522d44..fccf72daa0 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -696,13 +696,24 @@ PHP_MINIT_FUNCTION(curl) char **p = (char **)info->protocols; while (*p != NULL) { - php_register_url_stream_wrapper(*p++, &php_curl_wrapper TSRMLS_CC); + /* Do not enable cURL "file" protocol and make sure cURL is always used when --with-curlwrappers is enabled */ + if (strncasecmp(*p, "file", sizeof("file")-1) != 0) { + php_unregister_url_stream_wrapper(*p); + php_register_url_stream_wrapper(*p, &php_curl_wrapper TSRMLS_CC); + } + (void) *p++; } } # else + php_unregister_url_stream_wrapper("http"); php_register_url_stream_wrapper("http", &php_curl_wrapper TSRMLS_CC); + php_unregister_url_stream_wrapper("https"); php_register_url_stream_wrapper("https", &php_curl_wrapper TSRMLS_CC); + php_unregister_url_stream_wrapper("ftp"); php_register_url_stream_wrapper("ftp", &php_curl_wrapper TSRMLS_CC); + php_unregister_url_stream_wrapper("ftps"); + php_register_url_stream_wrapper("ftps", &php_curl_wrapper TSRMLS_CC); + php_unregister_url_stream_wrapper("ldap"); php_register_url_stream_wrapper("ldap", &php_curl_wrapper TSRMLS_CC); # endif #endif