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
第28行是foreach循环:
foreach ($paypal_ipn->paypal_post_vars as $key=>$value) {
if (getType($key)=="string") {
eval("\\$$key=\\$value;");
}
}
第30行也是foreach循环:
foreach($this->paypal_post_vars AS $key => $value) {
if (@get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
$values[] = "$key" . "=" . urlencode($value);
}
我认为这些错误的根本原因是:
//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);
类paypal\\u ipn的构造函数传递了一个非数组变量,因为尚未发送任何可填充的内容
$HTTP_POST_VARS
. Wordpress运行的代码不在其中时就不是这样了。我该如何摆脱这一切?