Merge branch 'MDL-46433-master' of git://github.com/lameze/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 28 Jul 2014 10:49:37 +0000 (11:49 +0100)
committerDan Poltawski <dan@moodle.com>
Mon, 28 Jul 2014 10:49:37 +0000 (11:49 +0100)
blog/lib.php

index 5b26916..b9cbae5 100644 (file)
@@ -180,9 +180,11 @@ function blog_sync_external_entries($externalblog) {
             $filtertags = array_map('trim', $filtertags);
             $filtertags = array_map('strtolower', $filtertags);
 
-            foreach ($categories as $category) {
-                if (in_array(trim(strtolower($category->term)), $filtertags)) {
-                    $containsfiltertag = true;
+            if (!empty($categories)) {
+                foreach ($categories as $category) {
+                    if (in_array(trim(strtolower($category->term)), $filtertags)) {
+                        $containsfiltertag = true;
+                    }
                 }
             }