Fixing rating= search

This commit is contained in:
Thasan 2013-11-05 22:43:46 +02:00
parent 81d44cbb4f
commit 5aa2f823d8

View file

@ -104,7 +104,7 @@ class Ratings extends Extension {
$set = Ratings::privs_to_sql(Ratings::get_user_privs($user));
$event->add_querylet(new Querylet("rating IN ($set)"));
}
if(preg_match("/^rating=(?:([sqeu]+)|(safe|questionable|explicit|unknown))$", strtolower($event->term), $matches)) {
if(preg_match("/^rating=(?:([sqeu]+)|(safe|questionable|explicit|unknown))$/D", strtolower($event->term), $matches)) {
$ratings = $matches[1] ? $matches[1] : array($matches[2][0]);
$ratings = array_intersect($ratings, str_split(Ratings::get_user_privs($user)));
$set = "'" . join("', '", $ratings) . "'";