Browse Source

DB::Chars: Fix SQL operator precedence bug in search filter

This would cause other filters to sometimes be ignored, depending on the
order in which the %where hash was being serialized.
https://vndb.org/t11605.3

Broken in 8802eac4f.
Yorhel 1 month ago
parent
commit
2586f9c786
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      lib/VNDB/DB/Chars.pm

+ 1
- 1
lib/VNDB/DB/Chars.pm View File

@@ -42,7 +42,7 @@ sub dbCharGet {
42 42
     defined $o{weight_min} ? ( 'c.weight >= ?' => $o{weight_min} ) : (),
43 43
     defined $o{weight_max} ? ( 'c.weight <= ? AND c.weight > 0' => $o{weight_max} ) : (),
44 44
     $o{search} ? (
45
-      "(c.name ILIKE ? OR translate(c.original,' ','') ILIKE translate(?,' ','')) OR c.alias ILIKE ?", [ map '%'.$o{search}.'%', 1..3 ] ) : (),
45
+      "(c.name ILIKE ? OR translate(c.original,' ','') ILIKE translate(?,' ','') OR c.alias ILIKE ?)", [ map '%'.$o{search}.'%', 1..3 ] ) : (),
46 46
     $o{char} ? (
47 47
       'LOWER(SUBSTR(c.name, 1, 1)) = ?' => $o{char} ) : (),
48 48
     defined $o{char} && !$o{char} ? (

Loading…
Cancel
Save