cvs: php4(PHP_4_0_7) /ext/curl curl.c
| From: | Sterling Hughes | Date: | Mon, 03 Dec 2001 09:26:02 +0000 |
| Subject: | cvs: php4(PHP_4_0_7) /ext/curl curl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-8405@lists.php.net to get a copy of this message | ||
sterling Mon Dec 3 04:26:02 2001 EDT
Modified files: (Branch: PHP_4_0_7)
/php4/ext/curl curl.c
Log:
MFH
Index: php4/ext/curl/curl.c
diff -u php4/ext/curl/curl.c:1.79.2.6 php4/ext/curl/curl.c:1.79.2.7
--- php4/ext/curl/curl.c:1.79.2.6 Tue Nov 20 06:55:34 2001
+++ php4/ext/curl/curl.c Mon Dec 3 04:26:02 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: curl.c,v 1.79.2.6 2001/11/20 11:55:34 sterling Exp $ */
+/* $Id: curl.c,v 1.79.2.7 2001/12/03 09:26:02 sterling Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -773,6 +773,7 @@
HashTable *postfields;
struct HttpPost *first = NULL;
struct HttpPost *last = NULL;
+ char *postval;
char *string_key = NULL;
ulong num_key;
uint string_key_len;
@@ -791,9 +792,15 @@
convert_to_string_ex(current);
zend_hash_get_current_key_ex(postfields, &string_key, &string_key_len, &num_key, 0,
NULL);
-
- error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key,
- CURLFORM_PTRCONTENTS, Z_STRVAL_PP(current), CURLFORM_END);
+ postval = Z_STRVAL_PP(current);
+ if (*postval == '@') {
+ error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key,
+ CURLFORM_FILE, ++postval, CURLFORM_END);
+ }
+ else {
+ error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key,
+ CURLFORM_PTRCONTENTS, postval, CURLFORM_END);
+ }
}
if (error != CURLE_OK) {