filetype search from ATravelingGeek

git-svn-id: file:///home/shish/svn/shimmie2/trunk@564 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-10-24 18:09:41 +00:00
parent c98f61496c
commit c47e15c01b

View File

@ -162,9 +162,11 @@ class Database {
} }
else if(preg_match("/(hash=|md5:)([0-9a-fA-F]*)/i", $term, $matches)) { else if(preg_match("/(hash=|md5:)([0-9a-fA-F]*)/i", $term, $matches)) {
$hash = strtolower($matches[2]); $hash = strtolower($matches[2]);
if(!is_null($hash)) {
$img_search->append(new Querylet("AND (images.hash = '$hash')")); $img_search->append(new Querylet("AND (images.hash = '$hash')"));
} }
else if(preg_match("/(filetype|ext)=([a-zA-Z0-9]*)/i", $term, $matches)) {
$ext = strtolower($matches[2]);
$img_search->append(new Querylet("AND (images.ext = '$ext')"));
} }
else { else {
$term = str_replace("*", "%", $term); $term = str_replace("*", "%", $term);