Bug #68321 [Opn->Nab]: Input variables issues, incorrect errors report
| From: | cmb@php.net | Date: | Thu, 25 Aug 2016 17:40:48 +0000 |
| Subject: | Bug #68321 [Opn->Nab]: Input variables issues, incorrect errors report | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-203550@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68321&edit=1
ID: 68321
Updated by: cmb@php.net
Reported by: blurkings at hotmail dot com
Summary: Input variables issues, incorrect errors report
-Status: Open
+Status: Not a bug
Type: Bug
Package: Scripting Engine problem
Operating System: CentOS 6.5
PHP Version: 5.4.34
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
> Why?
You are passing a plain (i.e. not urlencoded) string as value
of CURLOPT_POSTFIELDS. This is not supposed to work.
Previous Comments:
------------------------------------------------------------------------
[2014-10-29 08:56:28] blurkings at hotmail dot com
Description:
------------
I am running with PHP 5.4.33
Input variables is less than the limit, but always prompt me input variables exceed.
I extended to 10000, but still the same.
Array
(
[type] => 2
[message] => Unknown: Input variables exceeded 10000. To increase the limit change
max_input_vars in php.ini.
[file] => Unknown
[line] => 0
)
RAW data to submit:
-------------------
POST:
Array
(
[username] => user
[password] => password
[additional] =>
{"appName":"app","cicd":"","clientIP":"10.1.1.170","clientMac":"10:16:9e:8d:aa:12","clientName":"Asus
K012","clientPlatform":"Jelly
Bean,4.3","clientTyp":"MA"}
[api_Key] => 4ruOFVi94rFKYjEeeDeWAq/kYAZinqbi90KeoJYh2SNVL95GbYO8rDaP7g4N1w6L
[token] => {ieZivx5HZII=}{070YNK2R4bM=}{L1bXW5MgaM}{MzQ2c3BtbTltdTV1M2NsMTdybGtmbWU3ZTc=}{}
[from_datetime] =>
)
Why?
Test script:
---------------
$fields = array(
"username"=>$_POST['userid'],
"password"=>$_POST['passwd'],
"api_Key"=>"4ruOFVi94rFKYjEeeDeWAq/kYAZinqbi90KeoJYh2SNVL95GbYO8rDaP7g4N1w6L",
"additional"=>Array("appName"=>"app","cicd"=>"","clientIP"=>"10.1.1.170","clientMac"=>"10:16:9e:8d:aa:12","clientName"=>"Asus
K012", "clientPlatform"=>"Jelly Bean,4.3",
"clientTyp"=>"MA"),
"token"=>$_POST['token'],
"from_datetime"=>$_POST['from_datetime']
);
$fields_string = "";
foreach($fields as $key=>$value) {
if(is_array($value)){
$fields_string .= urldecode(http_build_query(array($key => $value)));
}else{
$fields_string .= $key.'='.$value.'&';
}
}
rtrim($fields_string,'&');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_HEADER, 0); // DO NOT RETURN HTTP HEADERS
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // RETURN THE CONTENTS OF THE CALL
curl_exec($ch);
curl_close($ch);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68321&edit=1