aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRicardo Soares de Lima <ricardo.soaresdelima@gmail.com>2012-12-09 16:08:02 -0200
committerChristian Weiske <cweiske@cweiske.de>2013-03-21 06:42:13 +0100
commit2f865db5132c65311f277586459bcbf4c026a8e6 (patch)
tree7c4e4d7052ee9b62af2a07355506d51b2e86c150 /src
parent3e2d817fc7fecf6b97c5989ca75a52414fbdf0af (diff)
downloadsemanticscuttle-2f865db5132c65311f277586459bcbf4c026a8e6.tar.gz
semanticscuttle-2f865db5132c65311f277586459bcbf4c026a8e6.tar.bz2
The method attachTags was raising a Notice error, fix it and adds a test for this situation.
Diffstat (limited to 'src')
-rw-r--r--src/SemanticScuttle/Service/Bookmark2Tag.php13
1 files changed, 7 insertions, 6 deletions
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');
+ }
}
}