From 1f55a12bf8711deea71845867ebd5d37d68076d9 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Wed, 23 Jul 2014 14:54:10 +0800 Subject: [PATCH] MDL-46433 blog: fix error message when creating an external blog --- blog/lib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/blog/lib.php b/blog/lib.php index 9190e465881..72ce6ce7ca0 100644 --- a/blog/lib.php +++ b/blog/lib.php @@ -181,9 +181,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; + } } }