#49 FIX function _prepare_post_body

open
nobody
None
5
2005-07-21
2005-07-21
Anonymous
No

Bad Request
Your browser sent a request that this server could not
understand.
function _prepare_post_body($formvars, $formfiles)
{
settype($formvars, "array");
settype($formfiles, "array");
$postdata = '';
if (count($formvars) == 0 && count($formfiles) == 0)
return;
switch ($this->_submit_type) {
case "application/x-www-form-urlencoded":
reset($formvars);
while(list($key,$val) = each($formvars)) {
if (is_array($val) || is_object($val)) {
while (list($cur_key, $cur_val) = each($val)) {
$postdata .= urlencode($key)."[]
=".urlencode($cur_val)."&";
}
}
else
$postdata .= urlencode($key)."=".urlencode
($val)."&";
}
/* insert this in the class
================================== */
$postdata=substr($postdata,0, strrpos ($postdata,'&'));
/* ================================ */
break;

Discussion