%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
# Try to find if we're adding a clause
foreach my $arg ( keys %ARGS ) {
- next unless $arg =~ m/^ValueOf([\w\.]+|'CF.{.*?}')$/
+ next unless $arg =~ m/^ValueOf([\w\.]+|'\w*CF\.\{.*?\}')$/
&& ( ref $ARGS{$arg} eq "ARRAY"
? grep $_ ne '', @{ $ARGS{$arg} }
: $ARGS{$arg} ne '' );
my ( $op, $value ) = ( $ops[$i], $values[$i] );
next if !defined $value || $value eq '';
- if ( $value eq 'NULL' && $op =~ /=/ ) {
+ if ( $value =~ /^NULL$/i && $op =~ /=/ ) {
if ( $op eq '=' ) {
$op = "IS";
}
$value = "'$value'";
}
- if ($keyword =~ /^'CF\.{(.*)}'/) {
- my $cf = $1;
+ if ($keyword =~ /^'(\w*CF)\.\{(.*)\}'/) {
+ my ($field, $cf) = ($1, $2);
$cf =~ s/(['\\])/\\$1/g;
- $keyword = "'CF.{$cf}'";
+ $keyword = "'$field.{$cf}'";
}
my $clause = {