picowiki icon indicating copy to clipboard operation
picowiki copied to clipboard

Argument #1 is not an array

Open I-am-possible opened this issue 7 years ago • 1 comments

After uploading it:

Warning: array_merge(): Argument #1 is not an array in /beta/index.php on line 77 Warning: array_merge(): Argument #1 is not an array in /beta/index.php on line 78

The lines are:

foreach (glob(dirname($pattern).'/*') as $dir) {
$first_files = array_merge($first_files, $this->readDirectory($dir.'/'.basename($pattern)));

Btw.: The users need PHP 5.4 and up, otherwise it will stop because of the [] synthax (and more). I am on 5.6 actually unless the dev says it will still work with 7.1.


EDIT: I also have this error: Warning: Invalid argument supplied for foreach() in /beta/backend/templates/_footer.php on line 5

EDIT2: And this one: 5 Warning: Invalid argument supplied for foreach() in /beta/backend/plugins/PluginAutoLink.php on line 18

I think they have just errors because of the same.

I-am-possible avatar Aug 23 '18 12:08 I-am-possible

Edit first line from: foreach (glob(dirname($pattern).'/*') as $dir) { To: foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR) as $dir) {

lukasfrydek avatar Jan 16 '20 18:01 lukasfrydek