From 2f865db5132c65311f277586459bcbf4c026a8e6 Mon Sep 17 00:00:00 2001 From: Ricardo Soares de Lima Date: Sun, 9 Dec 2012 16:08:02 -0200 Subject: The method attachTags was raising a Notice error, fix it and adds a test for this situation. --- src/SemanticScuttle/Service/Bookmark2Tag.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/SemanticScuttle/Service/Bookmark2Tag.php b/src/SemanticScuttle/Service/Bookmark2Tag.php index 6e8e28c..ed5e328 100644 --- a/src/SemanticScuttle/Service/Bookmark2Tag.php +++ b/src/SemanticScuttle/Service/Bookmark2Tag.php @@ -97,12 +97,13 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService $tags_count = is_array($tags)?count($tags):0; - - foreach($tags as $i => $tag) { - $tags[$i] = trim(utf8_strtolower($tags[$i])); - if ($fromApi) { - include_once 'SemanticScuttle/functions.php'; - $tags[$i] = convertTag($tags[$i], 'in'); + if (is_array($tags)) { + foreach($tags as $i => $tag) { + $tags[$i] = trim(utf8_strtolower($tags[$i])); + if ($fromApi) { + include_once 'SemanticScuttle/functions.php'; + $tags[$i] = convertTag($tags[$i], 'in'); + } } } -- cgit v1.2.3-54-g00ecf