- Fix HTTP content type header for RSS
- Add config option to allow sorting by bookmark creation date
instead of modification date
+- Fix bug #2887063: Common tag combination description feels broken
+
0.95.1 - 2009-11-16
-------------------
}
function addTagDescription($tag, $desc, $uId, $time) {
+ $tag = self::getSortedTag($tag);
+
// Check if no modification
$lastDesc = $this->getLastTagDescription($tag);
if($lastDesc['cdDescription'] == $desc) {
}
function getLastTagDescription($tag) {
+ $tag = self::getSortedTag($tag);
+
$query = "SELECT *";
$query.= " FROM `". $this->getTableName() ."`";
$query.= " WHERE tag='".$tag."'";
$this->db->sql_query($query);
}
+
+
+ /**
+ * Sorts a tag combination.
+ *
+ * Multiple tags are separated by "+" signs. Semantically,
+ * tag combinations like "blue+flower" and "flower+blue" are identical.
+ * This method sorts the single tags so i.e. the common bookmark description
+ * of "blue+flower" is also shown for "flower+blue".
+ *
+ * @param string $tag Single tag or tag combination ("+")
+ *
+ * @return string Sorted tag combination
+ */
+ protected static function getSortedTag($tag)
+ {
+ $tags = explode('+', $tag);
+ sort($tags);
+ return implode('+', $tags);
+ }
+
}
?>