}
if ( ! defined( $record->{$_} ) || $record->{$_} eq '' ) {
- if ( driver_name =~ /^Pg$/i ) {
- qq-( $_ IS NULL OR $_ = '' )-;
+ if ( $op eq '=' ) {
+ if ( driver_name =~ /^Pg$/i ) {
+ qq-( $_ IS NULL OR $_ = '' )-;
+ } else {
+ qq-( $_ IS NULL OR $_ = "" )-;
+ }
+ } elsif ( $op eq '!=' ) {
+ if ( driver_name =~ /^Pg$/i ) {
+ qq-( $_ IS NOT NULL AND $_ != '' )-;
+ } else {
+ qq-( $_ IS NOT NULL AND $_ != "" )-;
+ }
} else {
- qq-( $_ IS NULL OR $_ = "" )-;
+ if ( driver_name =~ /^Pg$/i ) {
+ qq-( $_ $op '' )-;
+ } else {
+ qq-( $_ $op "" )-;
+ }
}
} else {
"$_ $op ?";
=item ut_text COLUMN
Check/untaint text. Alphanumerics, spaces, and the following punctuation
-symbols are currently permitted: ! @ # $ % & ( ) - + ; : ' " , . ? /
+symbols are currently permitted: ! @ # $ % & ( ) - + ; : ' " , . ? / =
May not be null. If there is an error, returns the error, otherwise returns
false.
sub ut_text {
my($self,$field)=@_;
- warn "msgcat ". \&msgcat. "\n";
- warn "notexist ". \¬exist. "\n";
- warn "AUTOLOAD ". \&AUTOLOAD. "\n";
- $self->getfield($field) =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/]+)$/
+ #warn "msgcat ". \&msgcat. "\n";
+ #warn "notexist ". \¬exist. "\n";
+ #warn "AUTOLOAD ". \&AUTOLOAD. "\n";
+ $self->getfield($field) =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]+)$/
or return gettext('illegal_or_empty_text'). " $field: ".
$self->getfield($field);
$self->setfield($field,$1);
sub ut_textn {
my($self,$field)=@_;
- $self->getfield($field) =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/]*)$/
+ $self->getfield($field) =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/
or return gettext('illegal_text'). " $field: ". $self->getfield($field);
$self->setfield($field,$1);
'';
my($dbh)=dbh;
if ( $value =~ /^\d+(\.\d+)?$/ &&
# ! ( datatype($table,$field) =~ /^char/ )
- ! ( $dbdef->table($table)->column($field)->type =~ /(char|binary)$/i )
+ ! $dbdef->table($table)->column($field)->type =~ /(char|binary|text)$/i
) {
$value;
} else {