[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] PATCH: Testing States and Provinces...
****** message to minivend-users from "Jeff Carnahan" <jcarnahan@networq.com> ******
It seems that the state and province (and state_province) order profile
checks don't properly handle blank test situations. If a user leaves the
state (or province) field empty, the check will succeed. The patch (against
MV 4.04A) corrects this by ensuring that the user actually entered data into
the field being checked.
--
Jeff Carnahan - jcarnahan@networq.com
*** lib/Vend/Order-dist.pm Sat Jul 29 14:44:05 2000
--- lib/Vend/Order.pm Mon Jul 31 22:00:46 2000
***************
*** 1099,1105 ****
sub _state_province {
my($ref,$var,$val) = @_;
! if( $state =~ /\S/ and ($state =~ /\s$val\s/i or $province =~
/\s$val\s/i) ) {
return (1, $var, '');
}
else {
--- 1099,1105 ----
sub _state_province {
my($ref,$var,$val) = @_;
! if( $state =~ /\S/ and length($val) and ($state =~ /\s$val\s/i or
$province =~ /\s$val\s/i) ) {
return (1, $var, '');
}
else {
***************
*** 1112,1118 ****
$state = $::Variable->{MV_VALID_STATE}
if defined $::Variable->{MV_VALID_STATE};
! if( $state =~ /\S/ and $state =~ /\s$val\s/i ) {
return (1, $var, '');
}
else {
--- 1112,1118 ----
$state = $::Variable->{MV_VALID_STATE}
if defined $::Variable->{MV_VALID_STATE};
! if( $state =~ /\S/ and length($val) and $state =~ /\s$val\s/i ) {
return (1, $var, '');
}
else {
***************
*** 1124,1130 ****
my($ref,$var,$val) = @_;
$province = $::Variable->{MV_VALID_PROVINCE}
if defined $::Variable->{MV_VALID_PROVINCE};
! if( $province =~ /\s$val\s/i) {
return (1, $var, '');
}
else {
--- 1124,1130 ----
my($ref,$var,$val) = @_;
$province = $::Variable->{MV_VALID_PROVINCE}
if defined $::Variable->{MV_VALID_PROVINCE};
! if(length($val) and $province =~ /\s$val\s/i) {
return (1, $var, '');
}
else {
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list