From 66e6cdd0a175693776f62ea1883c6c3782348709 Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 22 Feb 2011 15:03:16 +0000 Subject: [PATCH] hopefully fix search by ID range, and related bits --- ext/index/main.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/index/main.php b/ext/index/main.php index be787314..5bf46d98 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -199,19 +199,19 @@ class Index extends SimpleExtension { $matches = array(); if(preg_match("/^size(<|>|<=|>=|=)(\d+)x(\d+)$/", $event->term, $matches)) { $cmp = $matches[1]; - $args = array(int_escape($matches[2]), int_escape($matches[3])); - $event->add_querylet(new Querylet("width $cmp ? AND height $cmp ?", $args)); + $args = array("width"=>int_escape($matches[2]), "height"=>int_escape($matches[3])); + $event->add_querylet(new Querylet("width $cmp :width AND height $cmp :height", $args)); } else if(preg_match("/^ratio(<|>|<=|>=|=)(\d+):(\d+)$/", $event->term, $matches)) { $cmp = $matches[1]; - $args = array(int_escape($matches[2]), int_escape($matches[3])); - $event->add_querylet(new Querylet("width / height $cmp ? / ?", $args)); + $args = array("width"=>int_escape($matches[2]), "height"=>int_escape($matches[3])); + $event->add_querylet(new Querylet("width / height $cmp :width / :height", $args)); } else if(preg_match("/^(filesize|id)(<|>|<=|>=|=)(\d+[kmg]?b?)$/i", $event->term, $matches)) { $col = $matches[1]; $cmp = $matches[2]; $val = parse_shorthand_int($matches[3]); - $event->add_querylet(new Querylet("images.$col $cmp ?", array($val))); + $event->add_querylet(new Querylet("images.$col $cmp :val", array("val"=>$val))); } else if(preg_match("/^(hash|md5)=([0-9a-fA-F]*)$/i", $event->term, $matches)) { $hash = strtolower($matches[2]);