From 980751e0573617a00caf15b117060050bc64840e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 10 Jul 2002 01:08:49 +0000 Subject: [PATCH] fix bug noticed by ed long ago... --- shift.cgi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shift.cgi b/shift.cgi index 295eda8..6738b82 100755 --- a/shift.cgi +++ b/shift.cgi @@ -2,7 +2,7 @@ #!/usr/bin/perl -Tw # (Text::Template can't do -T, but no user input is used dangerously) # -# $Id: shift.cgi,v 1.4 2000-09-23 18:10:54 ivan Exp $ +# $Id: shift.cgi,v 1.5 2002-07-10 01:08:49 ivan Exp $ # # Copyright (C) 2000 Adam Gould # Copyright (C) 2000 Michal Migurski @@ -40,7 +40,7 @@ END use strict; use vars qw( $template_file $data_directory $mail_smtpserver $mail_from $mail_subject @mail_cc $mail_footer - $cgi $template %shifthash %warning @messages ); + $cgi $template %shifthash %warning @messages $magic ); use subs qw( form inputbox ); use Fcntl ":flock"; use CGI 2.15; @@ -202,13 +202,15 @@ sub get_data { # subroutines for the template sub form { - $cgi->start_form; + $magic = defined $cgi->param('__MAGIC') ? $cgi->param('__MAGIC') : ''; + $cgi->delete_all(); + $cgi->start_form(); } sub inputbox { my $field = shift; return $shifthash{$field} || " " - if defined $cgi->param('__MAGIC') && $cgi->param('__MAGIC') eq 'print'; + if $magic eq 'print'; $shifthash{$field}='' unless defined $shifthash{$field}; $warning{$field}='' unless defined $warning{$field}; #"$field ". -- 2.11.0