php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67090 16953 post data variable maximum
Submitted: 2014-04-16 20:40 UTC Modified: 2014-04-17 07:14 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: trevor at ridgebizdev dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.4.27 OS: Windows7
Private report: No CVE-ID: None
 [2014-04-16 20:40 UTC] trevor at ridgebizdev dot com
Description:
------------
Based on the nature of this problem, it's ugly to reduce to a single line of code.  When ViewState (a session variable) is over 20k, the PHP request languages (cURL, PECL_HTTP, and file_get_contents()) all fail.

Test script:
---------------
  $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($ch, CURLOPT_URL, "https://www.budgettruck.com/Pick-Up-Location.aspx");
	curl_setopt($ch, CURLOPT_REFERER, "https://www.budgettruck.com/Pick-Up-Location.aspx");
	curl_setopt($ch, CURLOPT_HEADER, 1);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata4);
	curl_setopt($ch, CURLOPT_COOKIE, $cookie_str);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); 
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 55);
	curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $header_r);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla 5.0");
	curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
	curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
	curl_setopt($ch, CURLOPT_PROXY, "localhost");
	curl_setopt($ch, CURLOPT_PROXYPORT,"8888");
	$response4 = curl_exec($ch);

Expected result:
----------------
$response4 should be the html sourcecode of the "Drop Off Location Page".

Actual result:
--------------
HTTP/1.1 302 Moved Temporarily
Content-Type: text/html; charset=utf-8
Location: https://www.budgettruck.com/Default.aspx?tabid=54&error=An%20unexpected%20error%20has%20occurred&content=0
X-UA-Compatible: IE=edge
X-Powered-By: ASP.NET
Content-Length: 231
Expires: Wed, 16 Apr 2014 18:36:12 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Wed, 16 Apr 2014 18:36:12 GMT
Connection: keep-alive
Set-Cookie: language=en-US; path=/; secure; HttpOnly
Set-Cookie: datacenter=ptc

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://www.budgettruck.com/Default.aspx?tabid=54&amp;error=An%20unexpected%20error%20has%20occurred&amp;content=0">here</a>.</h2>
</body></html>

Patches

patchinappropriate (last revision 2014-04-16 20:41 UTC by trevor at ridgebizdev dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-16 20:56 UTC] aharvey@php.net
-Status: Open +Status: Feedback
 [2014-04-16 20:56 UTC] aharvey@php.net
Are you sure this works at all (from outside PHP)? This sounds and looks like a restriction on the www.budgettruck.com side in terms of the length of the cookie or POST data they'll accept, rather than a PHP restriction — the three methods you've described don't share any code, so they shouldn't all fail in the same way unless it's a server side problem.
 [2014-04-16 23:09 UTC] trevor at ridgebizdev dot com
-Status: Feedback +Status: Open
 [2014-04-16 23:09 UTC] trevor at ridgebizdev dot com
Good call.  Jeff Li at Ficstar took the app from me after about 10 instances of cat and mouse over 3 years.  He's got it, so PHP should be able to, as well...
 [2014-04-17 07:14 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2014-04-17 07:14 UTC] ab@php.net
@trevor at ridgebizdev dot com it's also ugly to post a half baked snippet like that. I've generated the post data for your example like $postdata4 = str_repeat('x', 42000); ignoring all the undefined variables. Also not using proxy, and this works, though despite warnings.

C:\php-sdk\php54\vc9\x86\php-src>e:\snaps\php-5.4.21-nts-Win32-VC9-x86\php -n -d extension_dir=e:\snaps\php-5.4.21-nts-Win32-VC9-x86\ext -d extension=php_curl.dll bug67090.php

Warning: curl_setopt(): You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE, CURLOPT_HTTP200ALIASES and CURLOPT_POSTQUOTE arguments in C:\php-sdk\php54\vc9\x86\php-src\bug67090.php on line 16
string(11060) "HTTP/1.1 100 Continue
Expires: Thu, 17 Apr 2014 07:09:54 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache

HTTP/1.1 302 Moved Temporarily
Content-Type: text/html; charset=utf-8
Location: https://www.budgettruck.com/ErrorCookiesNotEnabled.aspx
X-UA-Compatible: IE=edge
X-Powered-By: ASP.NET
Content-Length: 172
Expires: Thu, 17 Apr 2014 07:09:55 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Thu, 17 Apr 2014 07:09:55 GMT
Connection: keep-alive
Set-Cookie: .ASPXANONYMOUS=nt49352QzwEkAAAAZWFiNmNmY2MtMWZjMy00Mzg5LTk2ZDYtNDFjOWM1OTBiNmEw0; expires=Wed, 25-Jun-2014 17:49:54 GMT; path=/; HttpOnly
Set-Cookie: language=en-US; path=/; secure; HttpOnly
Set-Cookie: datacenter=ftc

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
X-UA-Compatible: IE=edge
X-Powered-By: ASP.NET
Expires: Thu, 17 Apr 2014 07:09:56 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Thu, 17 Apr 2014 07:09:56 GMT
Content-Length: 9664
Connection: keep-alive
Set-Cookie: .ASPXANONYMOUS=vtQF4J2QzwEkAAAAYzUzMWQwMGQtOWM5ZS00OGIzLWE1NjUtYTk4MWIzNzA5NTcz0; expires=Wed, 25-Jun-2014 17:49:55 GMT; path=/; HttpOnly
Set-Cookie: ASP.NET_SessionId=sks3zs0bvd4oymdlx5xdg1am; path=/; secure; HttpOnly
Set-Cookie: 51D=3155378975999999999; expires=Fri, 31-Dec-9999 23:59:59 GMT; path=/; secure; HttpOnly
Set-Cookie: datacenter=ftc


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head">
............................................. and so forth the page ......................................

I think your issue is your proxy or something in the data you send. Please recheck that and post a reliable self enclosed reproduce case.

Thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 21:01:31 2024 UTC