Demandbase: Invalid foreach() on line 76
-
There is a
flatten
function found on line 76 of libraries/Demandbase.php, which seems to be throwing two warnings in our error logs:“Invalid argument supplied for foreach()…” and “Cannot modify header information…”
In order to suppress the errors, I wrapped the function’s
foreach()
loop in aif(is_array($array))
conditional, which seems to have resolved the issue.Is there any harm in leaving this conditional check here? Should it be added directly to the plugin?
Environment Notes
- Plugin Version: 2.2.3
- WordPress Version: 4.5.3
- Multisite environment, but the plugin is being run on a per-site basis
- The topic ‘Demandbase: Invalid foreach() on line 76’ is closed to new replies.