/[gnump3d]/gnump3d/lib/gnump3d/plugins/search.pm
ViewVC logotype

Diff of /gnump3d/lib/gnump3d/plugins/search.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by skx, Sun Nov 2 14:06:21 2003 UTC revision 1.8 by skx, Sun Nov 2 19:15:07 2003 UTC
# Line 33  Line 33 
33  #  #
34  #  #
35    
36    use gnump3d::url;
37    
38  #  #
39  #  Return the author of this plugin.  #  Return the author of this plugin.
# Line 111  E_O_E Line 112  E_O_E
112          my @LINES = <CACHE>;          my @LINES = <CACHE>;
113          close( CACHE );          close( CACHE );
114    
115          my $searchingsomething = 0;          #
116            # description of our search terms
117          #          #
118          # Remove XSS attacks          my $searchsummary = '';
         #  
119    
120          foreach my $st (qw(q artist album song year genre))          foreach my $st (qw(q artist album song year genre))
121          {          {
122              if ( defined( $ARGUMENTS{$st} ) && length( $ARGUMENTS{$st} ) )              if ( defined( $ARGUMENTS{$st} ) && length( $ARGUMENTS{$st} ) )
123              {              {
124                    # Remove XSS attacks
125                  $ARGUMENTS{$st} =~ s/</&lt;/g;                  $ARGUMENTS{$st} =~ s/</&lt;/g;
126                  $ARGUMENTS{$st} =~ s/>/&gt;/g;                  $ARGUMENTS{$st} =~ s/>/&gt;/g;
127                    if ( $st eq 'q' )
128                    {
129                        $searchsummary .= $ARGUMENTS{$st} . ', ';
130                    }
131                    else
132                    {
133                        $searchsummary .= $st . ' ' . $ARGUMENTS{$st} . ', ';
134                    }
135              }              }
             $searchingsomething ++;  
136          }          }
137            $searchsummary =~ s/ $//g;
138            $searchsummary =~ s/,$//;
139    
140          if ( ! $searchingsomething )          if ( ! $searchsummary )
141          {          {
142              #              #
143              # we don't seem to be searching anything              # we don't seem to be searching anything
# Line 275  E_O_E Line 285  E_O_E
285                      $line =~ s/\$RELEASE/$RELEASE/g;                      $line =~ s/\$RELEASE/$RELEASE/g;
286                      $line =~ s/\$DIRECTORY/\//g;                      $line =~ s/\$DIRECTORY/\//g;
287                      $line =~ s/\$TITLE/Search Results/g;                      $line =~ s/\$TITLE/Search Results/g;
288                      $line =~ s/\$TERMS/$terms/g;                      $line =~ s/\$TERMS/$searchsummary/g;
289    
290                      if ( $line =~ /(.*)\$BANNER(.*)/ )                      if ( $line =~ /(.*)\$BANNER(.*)/ )
291                      {                      {
# Line 537  sub getSearchForm( $ ) Line 547  sub getSearchForm( $ )
547              my $count = 0;              my $count = 0;
548              foreach my $name ( @dirs )              foreach my $name ( @dirs )
549              {              {
550                    $name = gnump3d::url::encodeEntities($name);
551                  $text .= "<option value=\"$name\">$name</option>\n";                  $text .= "<option value=\"$name\">$name</option>\n";
552              }              }
553              $text .= "</select>\n";              $text .= "</select>\n";

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26