Ignore:
Timestamp:
09/23/11 17:36:06 (13 years ago)
Author:
Kris Deugau
Message:

/branches/htmlform

Remove stale, unused cleanInput(), desanitize() subs in CommonWeb.pm
Quickly hack up search.cgi to remove printAndExit() from CommonWeb.pm
See #15, #26

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/htmlform/cgi-bin/CommonWeb.pm

    r480 r502  
    1616$VERSION     = 1.00;
    1717@ISA         = qw(Exporter);
    18 @EXPORT_OK      = qw( &printError &printAndExit &desanitize &cleanInput &desanitize);
     18@EXPORT_OK      = qw( &printError );
    1919
    2020@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 )]
    2323                );
    2424
     
    3434}
    3535
    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 quotes
    50 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 
    7036# indicate that the module loaded okay.
    71371;
Note: See TracChangeset for help on using the changeset viewer.