git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 11bbc5ad authored by Evan Prodromou's avatar Evan Prodromou

a little more protection against empty tags

parent f2a9c9c2
......@@ -147,7 +147,7 @@ class TagSub extends Managed_DataObject
$keypart = sprintf('tagsub:by_profile:%d', $profile->id);
$tagstring = self::cacheGet($keypart);
if ($tagstring !== false) {
if ($tagstring !== false && !empty($tagstring)) {
$tags = explode(',', $tagstring);
} else {
$tagsub = new TagSub();
......@@ -155,7 +155,9 @@ class TagSub extends Managed_DataObject
if ($tagsub->find()) {
while ($tagsub->fetch()) {
$tags[] = $tagsub->tag;
if (!empty($tagsub->tag)) {
$tags[] = $tagsub->tag;
}
}
}
......
......@@ -62,12 +62,14 @@ class TagSubMenu extends Menu
$this->out->elementStart('ul', array('class' => 'nav'));
foreach ($this->tags as $tag) {
if (!empty($tag)) {
$this->out->menuItem(common_local_url('tag',
array('tag' => $tag)),
sprintf('#%s', $tag),
sprintf(_('Notices tagged with %s'), $tag),
$this->actionName == 'tag' && $this->action->arg('tag') == $tag,
'nav_streams_tag_'.$tag);
}
}
$this->out->elementEnd('ul');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment