From 98fa32478688743ec4ec98f40cd01ddb343c143c Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 2 Aug 2009 08:43:00 +0100 Subject: [PATCH] search for ratings with full words --- contrib/rating/main.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/rating/main.php b/contrib/rating/main.php index cdab8b4c..a729cfe9 100644 --- a/contrib/rating/main.php +++ b/contrib/rating/main.php @@ -125,6 +125,11 @@ class Ratings implements Extension { $set = join(', ', $arr); $event->add_querylet(new Querylet("rating IN ($set)")); } + if(preg_match("/^rating=(safe|questionable|explicit|unknown)$/", strtolower($event->term), $matches)) { + $text = $matches[1]; + $char = $text[0]; + $event->add_querylet(new Querylet("rating = ?", array($char))); + } } }