From: Tobias Diekershoff Date: Wed, 17 Apr 2013 15:32:31 +0000 (+0200) Subject: invalid arguments for a foreach loop found X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=960d1d99b28bae6d946ed2feaa44fc0b11b73d3f;p=friendica.git invalid arguments for a foreach loop found --- 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() {