function prepare($args)
 {
     parent::prepare($args);
     $this->q = $this->trimmed('q');
     // FIXME: very dependent on tag format
     if (preg_match('/^#([\\pL\\pN_\\-\\.]{1,64})/ue', $this->q)) {
         common_redirect(common_local_url('tag', array('tag' => common_canonical_tag(substr($this->q, 1)))), 303);
     }
     if (!empty($this->q)) {
         $profile = Profile::current();
         $stream = new SearchNoticeStream($this->q, $profile);
         $page = $this->trimmed('page');
         if (empty($page)) {
             $page = 1;
         } else {
             $page = (int) $page;
         }
         $this->notice = $stream->getNotices(($page - 1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
     }
     common_set_returnto($this->selfUrl());
     return true;
 }
 function prepare($args)
 {
     parent::prepare($args);
     common_set_returnto($this->selfUrl());
     return true;
 }