From f25ed214c62e0d6d20477477d476661ffb2e25d4 Mon Sep 17 00:00:00 2001 From: shish Date: Mon, 25 Jun 2007 16:40:47 +0000 Subject: [PATCH] search by hash, from artanis git-svn-id: file:///home/shish/svn/shimmie2/trunk@162 7f39781d-f577-437e-ae19-be835c7a54ca --- core/database.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/database.class.php b/core/database.class.php index 54fa73d9..315b4489 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -132,6 +132,12 @@ class Database { } $img_search->append(new Querylet("AND (owner_id = $user_id)")); } + else if(preg_match("/hash=([0-9a-fA-F]*)/i",$term,$matches)) { + $hash = strtolower($matches[1]); + if(!is_null($hash)) { + $img_search->append(new Querylet("AND (hash = '$hash')")); + } + } else { $term = str_replace("*", "%", $term); $term = str_replace("?", "_", $term);