Warning: Invalid argument supplied for foreach() in /.../ipn_res.php on line 28
Warning: Invalid argument supplied for foreach() in /.../ipn_cls.php on line 30
From line 28 is a foreach loop:
foreach ($paypal_ipn->paypal_post_vars as $key=>$value) {
if (getType($key)=="string") {
eval("\$$key=\$value;");
}
}
From line 30 is also a foreach loop:
foreach($this->paypal_post_vars AS $key => $value) {
if (@get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
$values[] = "$key" . "=" . urlencode($value);
}
And I think the root cause of the errors is this:
//This is located before foreach loop in ipn_res.php
require_once("ipn_cls.php");
$paypal_info = $HTTP_POST_VARS;
$paypal_ipn = new paypal_ipn($paypal_info);
The constructor of class paypal_ipn is passed with a non-array var because nothing has been sent yet that would fill out $HTTP_POST_VARS. Wordpress runs the code which is not the case when not in it. How do I get away from this?