]> granicus.if.org Git - php/commitdiff
- Fixed bug #49531 (CURLOPT_INFILESIZE sometimes causes warning "CURLPROTO_FILE canno...
authorFelipe Pena <felipe@php.net>
Wed, 23 Sep 2009 02:08:19 +0000 (02:08 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 23 Sep 2009 02:08:19 +0000 (02:08 +0000)
NEWS
ext/curl/interface.c

diff --git a/NEWS b/NEWS
index 4ec9fb51b79fee5a9ed93be57bf2831171e5c5b2..174a7c576f85cd0c8d0846b5bdb2ed9f7f71a2a8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP                                                                        NEWS
 ?? ??? ????, PHP 5.2.12
 - Fixed bug #49630 (imap_listscan function missing). (Felipe)
 - Fixed bug #49578 (make install-pear fails). (Hannes)
+- Fixed bug #49531 (CURLOPT_INFILESIZE sometimes causes warning "CURLPROTO_FILE
+  cannot be set"). (Felipe)
 
 17 Sep 2009, PHP 5.2.11
 - Fixed certificate validation inside php_openssl_apply_verification_policy.
index 3f7db13a3eb84cbbb7dbce1f93ecee58f73bbf83..f5b4c51de843f1ec4838e93ac7078bf7175c3cd9 100644 (file)
@@ -1361,7 +1361,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
 #endif
                        convert_to_long_ex(zvalue);
 #if LIBCURL_VERSION_NUM >= 0x71304
-                       if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && (Z_LVAL_PP(zvalue) & CURLPROTO_FILE)) {
+                       if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
+                               ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && (Z_LVAL_PP(zvalue) & CURLPROTO_FILE)) {
                                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLPROTO_FILE cannot be activated when in safe_mode or an open_basedir is set");
                                        RETVAL_FALSE;
                                        return 1;