diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index 8788882f..6dd293ab 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -390,14 +390,15 @@ class TagList extends Extension { } } - private function add_refine_block(Page $page, /*string*/ $search) { + private function add_refine_block(Page $page, /*array(string)*/ $search) { global $database; global $config; - $related_tags = $database->cache->get("related_tags:$search"); + $wild_tags = Tag::explode($search); + $str_search = Tag::implode($search); + $related_tags = $database->cache->get("related_tags:$str_search"); if(empty($related_tags)) { - $wild_tags = Tag::explode($search); // $search_tags = array(); $tag_id_array = array(); @@ -434,7 +435,7 @@ class TagList extends Extension { $args = array("limit"=>$config->get_int('tag_list_length')); $related_tags = $database->get_all($query, $args); - $database->cache->set("related_tags:$search", $related_tags, 60*60); + $database->cache->set("related_tags:$str_search", $related_tags, 60*60); } } diff --git a/ext/tag_list/theme.php b/ext/tag_list/theme.php index 2ed81e74..0d175730 100644 --- a/ext/tag_list/theme.php +++ b/ext/tag_list/theme.php @@ -135,7 +135,9 @@ class TagListTheme extends Themelet { $page->add_block(new Block("Refine Search", $html, "left", 60)); } - protected function ars($tag, $tags) { + protected function ars(/*string*/ $tag, /*array(string)*/ $tags) { + assert(is_array($tags)); + // FIXME: a better fix would be to make sure the inputs are correct $tag = strtolower($tag); $tags = array_map("strtolower", $tags);