From fdb6727f416c68859b21ff1d2517eb8e86010b6d Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 5 Apr 2012 16:18:41 +0100 Subject: [PATCH] don't fail at multiple searches on the same param (eg 'id>=X id<=Y') --- ext/index/main.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/index/main.php b/ext/index/main.php index ce3dbbce..f5244d54 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -129,6 +129,8 @@ class PostListBuildingEvent extends Event { } class Index extends Extension { + var $val_id = 0; + public function onInitExt(InitExtEvent $event) { global $config; $config->set_default_int("index_images", 24); @@ -206,10 +208,11 @@ class Index extends Extension { $event->add_querylet(new Querylet('width / height '.$cmp.' :width / :height', $args)); } else if(preg_match("/^(filesize|id)(<|>|<=|>=|=)(\d+[kmg]?b?)$/i", $event->term, $matches)) { + $this->val_id++; $col = $matches[1]; $cmp = $matches[2]; $val = parse_shorthand_int($matches[3]); - $event->add_querylet(new Querylet("images.$col $cmp :val", array("val"=>$val))); + $event->add_querylet(new Querylet("images.$col $cmp :val{$this->val_id}", array("val{$this->val_id}"=>$val))); } else if(preg_match("/^(hash|md5)=([0-9a-fA-F]*)$/i", $event->term, $matches)) { $hash = strtolower($matches[2]);