]> 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 7c817bfd2e32b3f044e82c0df92cd4503e35b264..7c23c632e5b295659b5b7fd15f05c2423cb9dd43 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ PHP                                                                        NEWS
   (Linus Nielsen Feltzing <linus@haxx.se>)
   
 - Fixed bug #49630 (imap_listscan function missing). (Felipe)
+- Fixed bug #49531 (CURLOPT_INFILESIZE sometimes causes warning "CURLPROTO_FILE
+  cannot be set"). (Felipe)
 
 
 ?? ??? 2009, PHP 5.3.1RC? <- WHY IS THIS HERE? Gonna be released after 5.3.1 or what??
index 749e6185816f0e5ead13b67e0898f7358e2fca3d..51c29dd3a9147975faf6a2fd8d1b39f9e0fc58be 100644 (file)
@@ -1649,7 +1649,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;