iliaa           Thu Jul  2 13:42:24 2009 UTC

  Modified files:              
    /php-src/ext/curl   interface.c 
  Log:
  
  MFB: Fixed bug #48733 (CURLOPT_WRITEHEADER|CURLOPT_FILE|CURLOPT_STDERR warns
  on files that have been opened with r+).
  
http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.174&r2=1.175&diff_format=u
Index: php-src/ext/curl/interface.c
diff -u php-src/ext/curl/interface.c:1.174 php-src/ext/curl/interface.c:1.175
--- php-src/ext/curl/interface.c:1.174  Sat Jun 27 21:20:25 2009
+++ php-src/ext/curl/interface.c        Thu Jul  2 13:42:24 2009
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: interface.c,v 1.174 2009/06/27 21:20:25 pajoye Exp $ */
+/* $Id: interface.c,v 1.175 2009/07/02 13:42:24 iliaa Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -1665,7 +1665,7 @@
                        error = CURLE_OK;
                        switch (option) {
                                case CURLOPT_FILE:
-                                       if (((php_stream *) what)->mode[0] != 
'r') {
+                                       if (((php_stream *) what)->mode[0] != 
'r' || ((php_stream *) what)->mode[1] == '+') {
                                                
zend_list_addref(Z_LVAL_PP(zvalue));
                                                ch->handlers->write->fp = fp;
                                                ch->handlers->write->method = 
PHP_CURL_FILE;
@@ -1676,7 +1676,7 @@
                                        }
                                        break;
                                case CURLOPT_WRITEHEADER:
-                                       if (((php_stream *) what)->mode[0] != 
'r') {
+                                       if (((php_stream *) what)->mode[0] != 
'r' || ((php_stream *) what)->mode[1] == '+') {
                                                
zend_list_addref(Z_LVAL_PP(zvalue));
                                                ch->handlers->write_header->fp 
= fp;
                                                
ch->handlers->write_header->method = PHP_CURL_FILE;
@@ -1692,7 +1692,7 @@
                                        ch->handlers->read->fd = 
Z_LVAL_PP(zvalue);
                                        break;
                                case CURLOPT_STDERR:
-                                       if (((php_stream *) what)->mode[0] != 
'r') {
+                                       if (((php_stream *) what)->mode[0] != 
'r' || ((php_stream *) what)->mode[1] == '+') {
                                                if (ch->handlers->std_err) {
                                                        
zval_ptr_dtor(&ch->handlers->std_err);
                                                }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to