hopefully fix search by ID range, and related bits
This commit is contained in:
parent
34b19c7738
commit
66e6cdd0a1
@ -199,19 +199,19 @@ class Index extends SimpleExtension {
|
|||||||
$matches = array();
|
$matches = array();
|
||||||
if(preg_match("/^size(<|>|<=|>=|=)(\d+)x(\d+)$/", $event->term, $matches)) {
|
if(preg_match("/^size(<|>|<=|>=|=)(\d+)x(\d+)$/", $event->term, $matches)) {
|
||||||
$cmp = $matches[1];
|
$cmp = $matches[1];
|
||||||
$args = array(int_escape($matches[2]), int_escape($matches[3]));
|
$args = array("width"=>int_escape($matches[2]), "height"=>int_escape($matches[3]));
|
||||||
$event->add_querylet(new Querylet("width $cmp ? AND height $cmp ?", $args));
|
$event->add_querylet(new Querylet("width $cmp :width AND height $cmp :height", $args));
|
||||||
}
|
}
|
||||||
else if(preg_match("/^ratio(<|>|<=|>=|=)(\d+):(\d+)$/", $event->term, $matches)) {
|
else if(preg_match("/^ratio(<|>|<=|>=|=)(\d+):(\d+)$/", $event->term, $matches)) {
|
||||||
$cmp = $matches[1];
|
$cmp = $matches[1];
|
||||||
$args = array(int_escape($matches[2]), int_escape($matches[3]));
|
$args = array("width"=>int_escape($matches[2]), "height"=>int_escape($matches[3]));
|
||||||
$event->add_querylet(new Querylet("width / height $cmp ? / ?", $args));
|
$event->add_querylet(new Querylet("width / height $cmp :width / :height", $args));
|
||||||
}
|
}
|
||||||
else if(preg_match("/^(filesize|id)(<|>|<=|>=|=)(\d+[kmg]?b?)$/i", $event->term, $matches)) {
|
else if(preg_match("/^(filesize|id)(<|>|<=|>=|=)(\d+[kmg]?b?)$/i", $event->term, $matches)) {
|
||||||
$col = $matches[1];
|
$col = $matches[1];
|
||||||
$cmp = $matches[2];
|
$cmp = $matches[2];
|
||||||
$val = parse_shorthand_int($matches[3]);
|
$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)) {
|
else if(preg_match("/^(hash|md5)=([0-9a-fA-F]*)$/i", $event->term, $matches)) {
|
||||||
$hash = strtolower($matches[2]);
|
$hash = strtolower($matches[2]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user