]> granicus.if.org Git - php/commitdiff
Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when an invalid...
authorIlia Alshanetsky <iliaa@php.net>
Tue, 2 Mar 2010 12:54:23 +0000 (12:54 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 2 Mar 2010 12:54:23 +0000 (12:54 +0000)
NEWS
ext/curl/interface.c

diff --git a/NEWS b/NEWS
index 99fa8b52b6d75de7df16f18160f80524844a826c..699910e7281aebb130e455ca85d267711f03c2ab 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ PHP                                                                        NEWS
 - Added stream filter support to mcrypt extension (ported from 
   mcrypt_filter). (Stas)
 
+- Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when    
+  an invalid option is provided). (Ilia)
 
 ?? ??? 20??, PHP 5.3.2
 - Upgraded bundled sqlite to version 3.6.22. (Ilia)
index 37388c59b844cca2706dc45ad4ed5b5db1e36aa7..5956b00fbeba00035c90852828100026dbc4e38c 100644 (file)
@@ -2095,6 +2095,11 @@ PHP_FUNCTION(curl_setopt)
 
        ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl);
 
+       if (options <= 0) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid curl configuration option");
+               RETURN_FALSE;
+       }
+
        if (!_php_curl_setopt(ch, options, zvalue, return_value TSRMLS_CC)) {
                RETURN_TRUE;
        } else {