33 |
# |
# |
34 |
# |
# |
35 |
|
|
36 |
|
use gnump3d::url; |
37 |
|
|
38 |
# |
# |
39 |
# Return the author of this plugin. |
# Return the author of this plugin. |
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/</</g; |
$ARGUMENTS{$st} =~ s/</</g; |
126 |
$ARGUMENTS{$st} =~ s/>/>/g; |
$ARGUMENTS{$st} =~ s/>/>/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 |
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 |
{ |
{ |
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"; |