From 7a177f82917a57bc1a0a8ef4a4608aca24773624 Mon Sep 17 00:00:00 2001 From: Mitch Jackson Date: Sun, 26 Aug 2018 17:07:46 -0400 Subject: [PATCH] RT# 80869 Harden process payment screen against Edge browser bug --- httemplate/elements/city.html | 4 ++-- httemplate/elements/cust_payby_new.html | 15 +++++---------- httemplate/elements/select-country.html | 10 ++++------ httemplate/elements/select-month_year.html | 5 ++--- httemplate/elements/select-state.html | 7 ++----- httemplate/elements/select-table.html | 8 ++++---- httemplate/misc/process/payment.cgi | 4 ++-- 7 files changed, 21 insertions(+), 32 deletions(-) diff --git a/httemplate/elements/city.html b/httemplate/elements/city.html index 4e9a60940..05250fef5 100644 --- a/httemplate/elements/city.html +++ b/httemplate/elements/city.html @@ -132,14 +132,14 @@ function <% $pre %>county_changed(what, callback) {} > % unless ( $opt{'disable_empty'} ) { - % } % foreach my $city ( @cities ) { % } diff --git a/httemplate/elements/cust_payby_new.html b/httemplate/elements/cust_payby_new.html index 7ed049686..8b1d93d59 100644 --- a/httemplate/elements/cust_payby_new.html +++ b/httemplate/elements/cust_payby_new.html @@ -4,7 +4,6 @@ % my( $payinfo, $paycvv, $month, $year ) = ( '', '', '', '' ); % my $payname = $cust_main->first. ' '. $cust_main->getfield('last'); % my $location = $cust_main->bill_location; - <% mt('Card number') |h %> @@ -15,21 +14,17 @@ <% mt('Exp.') |h %> / @@ -162,7 +157,7 @@ <% mt('as') |h %> % } else { diff --git a/httemplate/elements/select-country.html b/httemplate/elements/select-country.html index c98147907..286826752 100644 --- a/httemplate/elements/select-country.html +++ b/httemplate/elements/select-country.html @@ -91,15 +91,13 @@ Example: > % unless ( $opt{'disable_empty'} ) { - % } % foreach my $country ( @all_countries ) { - - % } diff --git a/httemplate/elements/select-month_year.html b/httemplate/elements/select-month_year.html index 62c10b15f..406c13b21 100644 --- a/httemplate/elements/select-month_year.html +++ b/httemplate/elements/select-month_year.html @@ -3,16 +3,15 @@ <% $empty ? ' % } - / diff --git a/httemplate/elements/select-state.html b/httemplate/elements/select-state.html index 3fb559734..8db157b92 100644 --- a/httemplate/elements/select-state.html +++ b/httemplate/elements/select-state.html @@ -27,16 +27,13 @@ Example: > % unless ( $opt{'disable_empty'} ) { - % } % foreach my $state ( keys %states ) { - - % } - <%init> diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index a52fdfaaa..d86b7ee43 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -83,11 +83,11 @@ Example: % || ( $value eq $pre_opt ); % } % unless ( $opt{'multiple'} || $opt{'disable_empty'} ) { - % } % foreach my $record ( @@ -118,7 +118,7 @@ Example: ? &{ $opt{'label_callback'} }( $record ) : $record->$name_col() |h - %> + %> % } % while ( @post_options ) { @@ -128,7 +128,7 @@ Example: % || ( $value eq $post_opt ); % } diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index d0e589661..7747bcbea 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -100,11 +100,11 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) { # use new info ## - $cgi->param('year') =~ /^(\d+)$/ + $cgi->param('year') =~ /^(\d{4})/ or errorpage("illegal year ". $cgi->param('year')); $year = $1; - $cgi->param('month') =~ /^(\d+)$/ + $cgi->param('month') =~ /^(\d{2})/ or errorpage("illegal month ". $cgi->param('month')); $month = $1; -- 2.11.0