From e340927b07a27debd2003f2dcb555346acce1b49 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 2 Aug 2009 08:57:30 +0100 Subject: [PATCH] also allow search by 'md5=' --- ext/index/main.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/index/main.php b/ext/index/main.php index 97b1016e..491fc42f 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -123,8 +123,8 @@ class Index extends SimpleExtension { $val = parse_shorthand_int($matches[3]); $event->add_querylet(new Querylet("images.$col $cmp ?", array($val))); } - else if(preg_match("/^hash=([0-9a-fA-F]*)$/i", $event->term, $matches)) { - $hash = strtolower($matches[1]); + else if(preg_match("/^(hash|md5)=([0-9a-fA-F]*)$/i", $event->term, $matches)) { + $hash = strtolower($matches[2]); $event->add_querylet(new Querylet("images.hash = '$hash'")); } else if(preg_match("/^(filetype|ext)=([a-zA-Z0-9]*)$/i", $event->term, $matches)) {