Quote:
Originally Posted by hyperspin
Also, seeing this error when trying to import files.
Warning: Invalid argument supplied for foreach() in [path]/admincp/downloads2.php on line 785
I'm not a coder, so I have no idea what this means or how to correct it, but line 785 of /admincp/downloads2.php shows the following:
foreach ($_POST['import'] AS $file => $null)
|
What that means is that what is in $_POST['import'] is not an array so you cannot apply a foreach to it. In order to eliminate the warning, which actually has no impact on anything, is to check if $_POST['import'] is actually an array, by wrapping the foreach in an if statement that checks if the variable is an array.
E.G.
PHP Code:
if(is_array($_POST['import'])) {
foreach ($_POST['import'] AS $file => $null){
//content of the foreach loop is here and unchanged
}
}
Does this happen for all imports or only some of them? If all imports then it might be a bug in the code. If some, then it might be that parameters are not being passed correctly when the import button is clicked.