summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-08-05 06:47:37 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-08-05 06:47:37 +0200
commit9c18fe1cc7e22077763baa545144cc01d5d94eab (patch)
treee02942d580ad6fdc8b4622c5d9575a3290ca2dca
parentc1528d1c5bf82d1a637fa6ac8b245e2a565f5f59 (diff)
downloadsemanticscuttle-9c18fe1cc7e22077763baa545144cc01d5d94eab.tar.gz
semanticscuttle-9c18fe1cc7e22077763baa545144cc01d5d94eab.tar.bz2
Fix bug #3386178: "system:unfiled" secret tag does not work
-rw-r--r--doc/ChangeLog1
-rw-r--r--src/SemanticScuttle/Service/Tag.php1
-rw-r--r--tests/Bookmark2TagTest.php9
3 files changed, 11 insertions, 0 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index b512d3c..d71a3d0 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -6,6 +6,7 @@ ChangeLog for SemantiScuttle
0.98.2 - 2011-08-XX
-------------------
- Fix bug #3385724: Rename tag ends with XML Parsing Error
+- Fix bug #3386178: "system:unfiled" secret tag does not work
0.98.1 - 2011-08-01
diff --git a/src/SemanticScuttle/Service/Tag.php b/src/SemanticScuttle/Service/Tag.php
index 8325285..2476608 100644
--- a/src/SemanticScuttle/Service/Tag.php
+++ b/src/SemanticScuttle/Service/Tag.php
@@ -143,6 +143,7 @@ class SemanticScuttle_Service_Tag extends SemanticScuttle_DbService
if(!is_array($tags)) {
$tags = utf8_strtolower(trim($tags));
} else {
+ $tags = array_filter($tags);//remove empty values
for($i=0; $i<count($tags); $i++) {
$tags[$i] = utf8_strtolower(trim($tags[$i]));
}
diff --git a/tests/Bookmark2TagTest.php b/tests/Bookmark2TagTest.php
index 1367a0e..f466a7d 100644
--- a/tests/Bookmark2TagTest.php
+++ b/tests/Bookmark2TagTest.php
@@ -80,6 +80,15 @@ class Bookmark2TagTest extends TestBase
);
}
+ public function testAttachTagsWithArrayWithEmptyStringAddsSystemUnfiled()
+ {
+ $bid = $this->addBookmark(null, null, 0, array(''));
+ $this->assertEquals(
+ array('system:unfiled'),
+ $this->b2ts->getTagsForBookmark($bid, true)
+ );
+ }
+
/**