Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45633 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67035 invoked from network); 23 Sep 2009 20:00:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2009 20:00:29 -0000 Received: from [127.0.0.1] ([127.0.0.1:2402]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 29/D2-51604-D5E7ABA4 for ; Wed, 23 Sep 2009 16:00:29 -0400 Authentication-Results: pb1.pair.com header.from=huf@parawag.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=huf@parawag.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain parawag.net from 212.108.200.67 cause and error) X-PHP-List-Original-Sender: huf@parawag.net X-Host-Fingerprint: 212.108.200.67 mail-gw1.sa.eol.hu Linux 2.6 Received: from [212.108.200.67] ([212.108.200.67:36485] helo=mail-gw1.sa.ew.hu) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/BD-49876-CDE4ABA4 for ; Wed, 23 Sep 2009 12:37:49 -0400 Received: from errno.parawag (mu.parawag.net [212.108.230.123]) by mail-gw1.sa.ew.hu (mu) with ESMTP id n8NGbh3g032636; Wed, 23 Sep 2009 18:37:44 +0200 Received: by errno.parawag (Postfix, from userid 110) id F16485E54D; Wed, 23 Sep 2009 18:37:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on errno.parawag X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED,UPPERCASE_25_50 autolearn=ham version=3.1.7-deb Received: from parawag.net (semuta.parawag [192.168.5.5]) by errno.parawag (Postfix) with ESMTP id 9F82E5E539; Wed, 23 Sep 2009 18:37:33 +0200 (CEST) Date: Wed, 23 Sep 2009 18:37:42 +0200 To: sterling@php.net Cc: internals@lists.php.net Message-ID: <20090923163742.GA11140@parawag.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Miltered: at mail-gw1 with ID 4ABA4ED7.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Score: MSGID : 4ABA4ED7.000 on mail-gw1 : j-chkmail score : . : R=. U=. O=. B=0.000 -> S=0.000 X-j-chkmail-Status: Ham Subject: [patch] for ext/curl (so you can post fields beginning with '@') From: huf@parawag.net (Berenyi Mihaly) --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline hi, sorry if i'm sending this to the wrong place, but here's a patch (of the PHP_5_2 branch) that adds an extra option to curl (CURLOPT_LITERAL_POSTFIELDS). it is the exact same thing as CURLOPT_POSTFIELDS, except it skips the check for leading '@' in the postdata, so you can post without fear or accidentally uploading a file. hope you like it and include it soon. bye, mihaly -- huf (Berenyi Mihaly) - huf@keszen.hu - http://parawag.net ...........it's life jim, but not as we know it........... --C7zPtVaVf+AK4Oqc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ext_curl_literal_postfields.patch" Index: ext/curl/interface.c =================================================================== --- ext/curl/interface.c (revision 288614) +++ ext/curl/interface.c (working copy) @@ -410,6 +410,7 @@ REGISTER_CURL_CONSTANT(CURLOPT_TIMEOUT_MS); #endif REGISTER_CURL_CONSTANT(CURLOPT_POSTFIELDS); + REGISTER_CURL_CONSTANT(CURLOPT_LITERAL_POSTFIELDS); REGISTER_CURL_CONSTANT(CURLOPT_REFERER); REGISTER_CURL_CONSTANT(CURLOPT_USERAGENT); REGISTER_CURL_CONSTANT(CURLOPT_FTPPORT); @@ -1559,6 +1560,7 @@ error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDDATA, (void *) ch); break; #endif + case CURLOPT_LITERAL_POSTFIELDS: case CURLOPT_POSTFIELDS: if (Z_TYPE_PP(zvalue) == IS_ARRAY || Z_TYPE_PP(zvalue) == IS_OBJECT) { zval **current; @@ -1592,7 +1594,7 @@ /* The arguments after _NAMELENGTH and _CONTENTSLENGTH * must be explicitly cast to long in curl_formadd * use since curl needs a long not an int. */ - if (*postval == '@') { + if (option == CURLOPT_POSTFIELDS && *postval == '@') { char *type, *filename; ++postval; Index: ext/curl/php_curl.h =================================================================== --- ext/curl/php_curl.h (revision 288614) +++ ext/curl/php_curl.h (working copy) @@ -42,6 +42,7 @@ #define CURLOPT_RETURNTRANSFER 19913 #define CURLOPT_BINARYTRANSFER 19914 +#define CURLOPT_LITERAL_POSTFIELDS 19915 #define PHP_CURL_STDOUT 0 #define PHP_CURL_FILE 1 #define PHP_CURL_USER 2 --C7zPtVaVf+AK4Oqc--