import rt 3.8.8
[freeside.git] / rt / lib / RT / Interface / Web / QueryBuilder / Tree.pm
index 574ead4..e672d8e 100755 (executable)
@@ -268,7 +268,11 @@ sub ParseSQL {
         }
 
         $value =~ s/'/\\'/g;
-        $value = "'$value'" if $value =~ /[^0-9]/;
+        if ( lc $op eq 'is' || lc $op eq 'is not' ) {
+            $value = 'NULL'; # just fix possible mistakes here
+        } elsif ( $value !~ /^[+-]?[0-9]+$/ ) {
+            $value = "'$value'";
+        }
         $key = "'$key'" if $key =~ /^CF./;
 
         my $clause = { Key => $key, Op => $op, Value => $value };