From 182605cb6a2e785df9051860232552211a43a052 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Fri, 4 Jul 2014 19:32:57 +0200 Subject: [PATCH] TagAction extends ManagedAction --- actions/tag.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/actions/tag.php b/actions/tag.php index 21cae9aba5..5e52630c85 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -17,26 +17,28 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('GNUSOCIAL')) { exit(1); } // @todo FIXME: documentation missing. -class TagAction extends Action +class TagAction extends ManagedAction { var $notice; var $tag; var $page; - function prepare($args) + protected function prepare(array $args=array()) { parent::prepare($args); + $taginput = $this->trimmed('tag'); $this->tag = common_canonical_tag($taginput); - if (!$this->tag) { + if (empty($this->tag)) { common_redirect(common_local_url('publictagcloud'), 301); } - if ($this->tag != $taginput) { + // after common_canonical_tag we have a lowercase, no-specials tag string + if ($this->tag !== $taginput) { common_redirect(common_local_url('tag', array('tag' => $this->tag)), 301); } @@ -69,13 +71,6 @@ class TagAction extends Action } } - function handle($args) - { - parent::handle($args); - - $this->showPage(); - } - function getFeeds() { return array(new Feed(Feed::JSON, @@ -111,7 +106,7 @@ class TagAction extends Action $this->tag))); } - function showContent() + protected function showContent() { if(Event::handle('StartTagShowContent', array($this))) {