Fixed post search parsing

This commit is contained in:
Marcin Kurczewski 2014-10-07 20:58:09 +02:00
parent d1c2c77eb5
commit 287c3c1cb3
4 changed files with 9 additions and 5 deletions

View file

@ -137,7 +137,7 @@ abstract class AbstractSearchParser
}
$colonPosition = strpos($tokenText, ':');
if ($colonPosition !== false and $colonPosition > 0)
if (($colonPosition !== false) and ($colonPosition > 0))
{
$searchToken = new \Szurubooru\SearchServices\Tokens\NamedSearchToken();
list ($tokenKey, $tokenValue) = explode(':', $tokenText, 2);

View file

@ -76,7 +76,8 @@ class PostSearchParser extends AbstractSearchParser
$this->decorateFilterFromNamedToken($filter, $token);
}
throw new \Szurubooru\NotSupportedException();
else
throw new \Szurubooru\NotSupportedException();
}
protected function getOrderColumn($token)
@ -114,7 +115,8 @@ class PostSearchParser extends AbstractSearchParser
elseif ($token === 'fav_time')
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_LAST_FAV_TIME;
throw new \Szurubooru\NotSupportedException();
else
throw new \Szurubooru\NotSupportedException();
}
private function addIdRequirement($filter, $token)

View file

@ -32,6 +32,7 @@ class TagSearchParser extends AbstractSearchParser
elseif ($token === 'usage_count')
return \Szurubooru\SearchServices\Filters\TagFilter::ORDER_USAGE_COUNT;
throw new \Szurubooru\NotSupportedException();
else
throw new \Szurubooru\NotSupportedException();
}
}

View file

@ -26,6 +26,7 @@ class UserSearchParser extends AbstractSearchParser
elseif ($token === 'registration_time')
return \Szurubooru\SearchServices\Filters\UserFilter::ORDER_REGISTRATION_TIME;
throw new \Szurubooru\NotSupportedException();
else
throw new \Szurubooru\NotSupportedException();
}
}