Changeset 502 for branches/htmlform/cgi-bin/CommonWeb.pm
- Timestamp:
- 09/23/11 17:36:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/htmlform/cgi-bin/CommonWeb.pm
r480 r502 16 16 $VERSION = 1.00; 17 17 @ISA = qw(Exporter); 18 @EXPORT_OK = qw( &printError &printAndExit &desanitize &cleanInput &desanitize);18 @EXPORT_OK = qw( &printError ); 19 19 20 20 @EXPORT = (); #export nothing by default 21 %EXPORT_TAGS = ( ALL => [qw( &printError &printAndExit &desanitize &cleanInput)],22 lean => [qw( &printError &printAndExit &cleanInput)]21 %EXPORT_TAGS = ( ALL => [qw( &printError )], 22 lean => [qw( &printError )] 23 23 ); 24 24 … … 34 34 } 35 35 36 sub printAndExit($)37 {38 my $errStr = $_[0];39 print qq(40 <center><p class="regular"> $errStr </p>41 <input type="button" value="Back" onclick="history.go(-1)">42 </center>43 );44 print "<br>would print footer but already dun gone and shot(self->foot)\n";45 exit(0);46 }47 48 # needs a reference to the webvar hash.49 # takes out backticks and single quotes50 sub cleanInput($)51 {52 my $hashRef = $_[0];53 54 foreach my $key (keys %$hashRef)55 {56 $hashRef->{$key} =~ s/`/\\`/g;57 $hashRef->{$key} =~ s/'/\'/g;58 }59 }60 61 # undoes clean input. takes a string as an arg.62 sub desanitize($)63 {64 my $string = $_[0];65 $string =~ s/\\`/`/g;66 $string =~ s/\\'/'/g;67 return $string;68 }69 70 36 # indicate that the module loaded okay. 71 37 1;
Note:
See TracChangeset
for help on using the changeset viewer.