Commit cfff80a7 authored by Evan Prodromou's avatar Evan Prodromou

If you search for a tag, redirect to tag page

parent 638d29a8
......@@ -48,10 +48,21 @@ require_once INSTALLDIR.'/lib/searchaction.php';
*/
class NoticesearchAction extends SearchAction
{
protected $q = null;
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);
}
common_set_returnto($this->selfUrl());
return true;
......
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