com php-src: fix bad merge: ext/curl/interface.c
| From: | Stanislav Malyshev | Date: | Tue, 14 Oct 2014 18:17:48 +0000 |
| Subject: | com php-src: fix bad merge: ext/curl/interface.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82307@lists.php.net to get a copy of this message | ||
Commit: d9559d0ecd81ea09575cdbb20e908d5516cad4ad
Author: Stanislav Malyshev <stas@php.net> Tue, 14 Oct 2014 11:17:48 -0700
Parents: abe907b34351e7e08c6d512ec437dee8805bb2f7
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d9559d0ecd81ea09575cdbb20e908d5516cad4ad
Log:
fix bad merge
Changed paths:
M ext/curl/interface.c
Diff:
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 65894c7..3a09436 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -178,12 +178,25 @@ static int php_curl_option_str(php_curl *ch, zend_long option, const char
*str,
#if LIBCURL_VERSION_NUM >= 0x071100
if (make_copy) {
#endif
+ char *copystr;
- if (strlen(url) != len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters
(\\0)");
- return 0;
+ /* Strings passed to libcurl as 'char *' arguments, are copied by the library since
7.17.0 */
+ copystr = estrndup(str, len);
+ error = curl_easy_setopt(ch->cp, option, copystr);
+ zend_llist_add_element(&ch->to_free->str, ©str);
+#if LIBCURL_VERSION_NUM >= 0x071100
+ } else {
+ error = curl_easy_setopt(ch->cp, option, str);
}
+#endif
+ SAVE_CURL_ERROR(ch, error)
+
+ return error == CURLE_OK ? SUCCESS : FAILURE;
+}
+
+static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRMLS_DC) /* {{{ */
+{
/* Disable file:// if open_basedir are used */
if (PG(open_basedir) && *PG(open_basedir)) {
#if LIBCURL_VERSION_NUM >= 0x071304