]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
a little more protection against empty tags
authorEvan Prodromou <evan@status.net>
Tue, 5 Apr 2011 22:36:49 +0000 (18:36 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 5 Apr 2011 22:36:49 +0000 (18:36 -0400)
plugins/TagSub/TagSub.php
plugins/TagSub/tagsubmenu.php

index c2da072693c6a892db206f93f89552387c705ff5..9662811bf9ffa30b6770a4c164b03daaddc3f233 100644 (file)
@@ -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;
+                    }
                 }
             }
 
index e2ddf04ef9893e321ba298acb688f2a77dd5617f..e57a8a8a97252c9b421814f4dfe66cd864d315ea 100644 (file)
@@ -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');