From 3b236eac5f7926f18623f6b9dc7c6f0d350ab61c 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/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/payment.cgi | 8 +++----- httemplate/misc/process/payment.cgi | 4 ++-- 7 files changed, 19 insertions(+), 27 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/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 ad84b915d..9091bae5d 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 115a98d98..7606e2527 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 3f6c8805d..4ac0887fd 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'} ) { - % } % # XXX fix this eventually, when we have time to test it @@ -117,7 +117,7 @@ Example: ? &{ $opt{'label_callback'} }( $record ) : $record->$name_col() |h - %> + %> % } % while ( @post_options ) { @@ -127,7 +127,7 @@ Example: % || ( $value eq $post_opt ); % } diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index 44904fba6..9e530cf0a 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -59,9 +59,8 @@ <% mt('Exp.') |h %> @@ -70,8 +69,7 @@ diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 9458217c1..5f945a71a 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -42,11 +42,11 @@ if ( $cgi->param('fee') =~ /^\s*(\d*(\.\d\d)?)\s*$/ ) { $amount = sprintf('%.2f', $amount + $fee); } -$cgi->param('year') =~ /^(\d+)$/ +$cgi->param('year') =~ /^(\d{4})/ or errorpage("illegal year ". $cgi->param('year')); my $year = $1; -$cgi->param('month') =~ /^(\d+)$/ +$cgi->param('month') =~ /^(\d{2})/ or errorpage("illegal month ". $cgi->param('month')); my $month = $1; -- 2.11.0