be more strict about allowed comparisons
git-svn-id: file:///home/shish/svn/shimmie2/trunk@19 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
f0802f2f1c
commit
71392a73a5
1 changed files with 3 additions and 3 deletions
|
@ -93,17 +93,17 @@ class Database {
|
||||||
$term = $this->resolve_alias($term);
|
$term = $this->resolve_alias($term);
|
||||||
|
|
||||||
$matches = array();
|
$matches = array();
|
||||||
if(preg_match("/size([><=]+)(\d+)x(\d+)/", $term, $matches)) {
|
if(preg_match("/size(<|>|<=|>=|=)(\d+)x(\d+)/", $term, $matches)) {
|
||||||
$cmp = $matches[1];
|
$cmp = $matches[1];
|
||||||
$args = array(int_escape($matches[2]), int_escape($matches[3]));
|
$args = array(int_escape($matches[2]), int_escape($matches[3]));
|
||||||
$img_search->append(new Querylet("AND (width $cmp ? AND height $cmp ?)", $args));
|
$img_search->append(new Querylet("AND (width $cmp ? AND height $cmp ?)", $args));
|
||||||
}
|
}
|
||||||
else if(preg_match("/ratio([><=]+)(\d+):(\d+)/", $term, $matches)) {
|
else if(preg_match("/ratio(<|>|<=|>=|=)(\d+):(\d+)/", $term, $matches)) {
|
||||||
$cmp = $matches[1];
|
$cmp = $matches[1];
|
||||||
$args = array(int_escape($matches[2]), int_escape($matches[3]));
|
$args = array(int_escape($matches[2]), int_escape($matches[3]));
|
||||||
$img_search->append(new Querylet("AND (width / height $cmp ? / ?)", $args));
|
$img_search->append(new Querylet("AND (width / height $cmp ? / ?)", $args));
|
||||||
}
|
}
|
||||||
else if(preg_match("/(filesize|id)([><=]+)([\dKMGB]+)/i", $term, $matches)) {
|
else if(preg_match("/(filesize|id)(<|>|<=|>=|=)([\dKMGB]+)/i", $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]);
|
||||||
|
|
Reference in a new issue