iliaa           Thu Jul  2 13:41:29 2009 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/curl   interface.c 
    /php-src    NEWS 
  Log:
  
  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.62.2.14.2.58&r2=1.62.2.14.2.59&diff_format=u
Index: php-src/ext/curl/interface.c
diff -u php-src/ext/curl/interface.c:1.62.2.14.2.58 
php-src/ext/curl/interface.c:1.62.2.14.2.59
--- php-src/ext/curl/interface.c:1.62.2.14.2.58 Sun Jun 28 10:00:28 2009
+++ php-src/ext/curl/interface.c        Thu Jul  2 13:41:29 2009
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: interface.c,v 1.62.2.14.2.58 2009/06/28 10:00:28 pajoye Exp $ */
+/* $Id: interface.c,v 1.62.2.14.2.59 2009/07/02 13:41:29 iliaa Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -1436,7 +1436,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;
@@ -1447,7 +1447,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;
@@ -1463,7 +1463,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);
                                                }
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1576&r2=1.2027.2.547.2.1577&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1576 php-src/NEWS:1.2027.2.547.2.1577
--- php-src/NEWS:1.2027.2.547.2.1576    Wed Jul  1 18:46:53 2009
+++ php-src/NEWS        Thu Jul  2 13:41:29 2009
@@ -4,6 +4,8 @@
 - Fixed regression in cURL extension that prevented flush of data to output
   defined as a file handle. (Ilia)
 
+- Fixed bug #48733 (CURLOPT_WRITEHEADER|CURLOPT_FILE|CURLOPT_STDERR warns on
+  files that have been opened with r+). (Ilia)
 - Fixed bug #48709 (metaphone and 'wh'). (brettz9 at yahoo dot com, Felipe)
 - Fixed bug #48693 (Double declaration of __lambda_func when lambda wrongly
   formatted). (peter at lvp-media dot com, Felipe)



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

Reply via email to