Permalink
Browse files

This may fix the bug: PHP Warning: Invalid argument supplied for fore…

…ach() in /[piwikdir]/core/CliMulti.php on line 176

 reported on forums
  • Loading branch information...
mattab committed Mar 8, 2014
1 parent d040733 commit 4ec3413635f43d552b8d50944615533cfe341f8f
Showing with 6 additions and 1 deletion.
  1. +6 −1 core/CliMulti.php
View
@@ -175,7 +175,12 @@ public static function cleanupNotRemovedFiles()
{
$timeOneWeekAgo = strtotime('-1 week');
- foreach (_glob(self::getTmpPath() . '/*') as $file) {
+ $files = _glob(self::getTmpPath() . '/*');
+ if(empty($files)) {
+ return;
+ }
+
+ foreach ($files as $file) {
$timeLastModified = filemtime($file);
if ($timeOneWeekAgo > $timeLastModified) {

2 comments on commit 4ec3413

Fix the problem! :)

Same here. Fixed the foreach bug.

Please sign in to comment.