forked from Cavemanon/cavepaintings
add support for using : as a metatag seperator + updated docs
This commit is contained in:
@@ -116,7 +116,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))$/D", 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(str_split($ratings), str_split(Ratings::get_user_privs($user)));
|
||||
$set = "'" . join("', '", $ratings) . "'";
|
||||
@@ -199,7 +199,7 @@ class Ratings extends Extension {
|
||||
|
||||
private function no_rating_query($context) {
|
||||
foreach($context as $term) {
|
||||
if(preg_match("/^rating=/", $term)) {
|
||||
if(preg_match("/^rating[=|:]/", $term)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user