From 960d1d99b28bae6d946ed2feaa44fc0b11b73d3f Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 17 Apr 2013 17:32:31 +0200 Subject: [PATCH] invalid arguments for a foreach loop found --- include/tags.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/tags.php b/include/tags.php index c81a752d54..6e73f616cb 100644 --- a/include/tags.php +++ b/include/tags.php @@ -106,8 +106,10 @@ function create_tags_from_item($itemid) { function create_tags_from_itemuri($itemuri, $uid) { $messages = q("SELECT `id` FROM `item` WHERE uri ='%s' AND uid=%d", dbesc($itemuri), intval($uid)); - foreach ($messages as $message) - create_tags_from_item($message["id"]); + if(count($messages)) { + foreach ($messages as $message) + create_tags_from_item($message["id"]); + } } function update_items() {