Changes: - output changes to produce proper XHTML 1.0 output (note: only default template modified; other templates need work too) - gnump3d::url::encodeEntities: a naive implementation - search description on the results page works again Index: ChangeLog =================================================================== RCS file: /cvsroot/gnump3d/gnump3d/ChangeLog,v retrieving revision 1.40 diff -u -r1.40 ChangeLog --- ChangeLog 2 Nov 2003 14:18:29 -0000 1.40 +++ ChangeLog 2 Nov 2003 16:44:48 -0000 @@ -34,12 +34,14 @@ - BUGFIX: 'Random Selection' on the directory index links properly. - BUGFIX: Added several new test scripts. - BUGFIX: Advanced playlists contain the track lengths in seconds. - - BUGFIX: gnump3d-index has a valid shebang ling. - - BUGFIX: Searching with no terms returns an error. + - BUGFIX: gnump3d-index has a valid shebang line. + - BUGFIX: Searching with no terms returns an error rather than all files. + - BUGFIX: Searching on genre fixed. + - BUGFIX: XHTML 1.0 output cleanups. - PLUGINS: preferences plugin shows installed languages. - (doesnt allow switching; wanna encourage more contributiosn) - - PLUGINS: Searching has been enhanced to support artist, etc. + (doesnt allow switching; wanna encourage more contributions) + - PLUGINS: Now possible to searching artist, album, or song title. Index: bin/gnump3d2 =================================================================== RCS file: /cvsroot/gnump3d/gnump3d/bin/gnump3d2,v retrieving revision 1.41 diff -u -r1.41 gnump3d2 --- bin/gnump3d2 2 Nov 2003 14:22:12 -0000 1.41 +++ bin/gnump3d2 2 Nov 2003 16:44:49 -0000 @@ -2346,17 +2346,36 @@ { $total =~ s/.*<\/PLAYLISTS>//gsx; } + else + { + $total =~ s/<\/?PLAYLISTS>//g; + } + if ( $totalFiles eq 0 ) { $total =~ s/.*<\/FILES>//gsx; } + else + { + $total =~ s/<\/?FILES>//g; + } + if ( $totalSubdirs eq 0 ) { $total =~ s/.*<\/DIRS>//gsx; } + else + { + $total =~ s/<\/?DIRS>//g; + } + if ( $totalMovies eq 0 ) { $total =~ s/.*<\/MOVIES>//gsx; + } + else + { + $total =~ s/<\/?MOVIES>//g; } # Index: etc/gnump3d.conf =================================================================== RCS file: /cvsroot/gnump3d/gnump3d/etc/gnump3d.conf,v retrieving revision 1.7 diff -u -r1.7 gnump3d.conf --- etc/gnump3d.conf 1 Nov 2003 16:23:20 -0000 1.7 +++ etc/gnump3d.conf 2 Nov 2003 16:44:49 -0000 @@ -485,7 +485,7 @@ # $RECURSE = A link to play the contents of the directory recursively. # # -directory_format =  $DIR_NAME$SONG_COUNT$DIR_COUNT[$RECURSE] +directory_format =  $DIR_NAME$SONG_COUNT$DIR_COUNT[$RECURSE] # # directory_format = $DIR_NAME Index: lib/gnump3d/tagcache.pm =================================================================== RCS file: /cvsroot/gnump3d/gnump3d/lib/gnump3d/tagcache.pm,v retrieving revision 1.3 diff -u -r1.3 tagcache.pm --- lib/gnump3d/tagcache.pm 31 Oct 2003 17:16:37 -0000 1.3 +++ lib/gnump3d/tagcache.pm 2 Nov 2003 16:44:49 -0000 @@ -36,6 +36,7 @@ use gnump3d::ogginfo; use gnump3d::mp3info; use gnump3d::oggtagreader; +use gnump3d::url; # set the version for version checking my $VERSION = '$Revision: 1.3 $'; @@ -401,7 +402,7 @@ if (defined( $TAGS{$key} ) ) { # Do the insertion. - $format = $pre . $TAGS{$key} . $post; + $format = $pre . gnump3d::url::encodeEntities( $TAGS{$key} ) . $post; } else { @@ -442,7 +443,7 @@ return($format); - } +} # Index: lib/gnump3d/url.pm =================================================================== RCS file: /cvsroot/gnump3d/gnump3d/lib/gnump3d/url.pm,v retrieving revision 1.2 diff -u -r1.2 url.pm --- lib/gnump3d/url.pm 23 Oct 2003 09:00:40 -0000 1.2 +++ lib/gnump3d/url.pm 2 Nov 2003 16:44:49 -0000 @@ -91,7 +91,7 @@ sub encodeEntities( $ ) { my ( $text ) = ( @_ ); - + $text =~ s/&/&/g; return( $text ); } Index: lib/gnump3d/plugins/random.pm =================================================================== RCS file: /cvsroot/gnump3d/gnump3d/lib/gnump3d/plugins/random.pm,v retrieving revision 1.6 diff -u -r1.6 random.pm --- lib/gnump3d/plugins/random.pm 27 Oct 2003 19:29:36 -0000 1.6 +++ lib/gnump3d/plugins/random.pm 2 Nov 2003 16:44:49 -0000 @@ -223,10 +223,10 @@ # Escape the link to the songs. $file = &urlEncode( $file ); - $form .= "\n"; + $form .= "\n"; $count ++; } - $form .= "\n"; + $form .= "\n"; $form .= "\n"; @@ -245,7 +245,7 @@ $form .= "\n"; $form .= "\n"; $form .= "\n"; - $form .= "\n"; + $form .= "\n"; $form .= "[ Random Directory ] \n"; $output .= $form; Index: lib/gnump3d/plugins/search.pm =================================================================== RCS file: /cvsroot/gnump3d/gnump3d/lib/gnump3d/plugins/search.pm,v retrieving revision 1.7 diff -u -r1.7 search.pm --- lib/gnump3d/plugins/search.pm 2 Nov 2003 14:06:21 -0000 1.7 +++ lib/gnump3d/plugins/search.pm 2 Nov 2003 16:44:49 -0000 @@ -33,6 +33,7 @@ # # +use gnump3d::url; # # Return the author of this plugin. @@ -111,23 +112,32 @@ my @LINES = ; close( CACHE ); - my $searchingsomething = 0; - - # - # Remove XSS attacks - # + # + # description of our search terms + # + my $searchsummary = ''; foreach my $st (qw(q artist album song year genre)) { if ( defined( $ARGUMENTS{$st} ) && length( $ARGUMENTS{$st} ) ) { + # Remove XSS attacks $ARGUMENTS{$st} =~ s//>/g; + if ( $st eq 'q' ) + { + $searchsummary .= $ARGUMENTS{$st} . ', '; + } + else + { + $searchsummary .= $st . ' ' . $ARGUMENTS{$st} . ', '; + } } - $searchingsomething ++; } + $searchsummary =~ s/ $//g; + $searchsummary =~ s/,$//; - if ( ! $searchingsomething ) + if ( ! $searchsummary ) { # # we don't seem to be searching anything @@ -275,7 +285,7 @@ $line =~ s/\$RELEASE/$RELEASE/g; $line =~ s/\$DIRECTORY/\//g; $line =~ s/\$TITLE/Search Results/g; - $line =~ s/\$TERMS/$terms/g; + $line =~ s/\$TERMS/$searchsummary/g; if ( $line =~ /(.*)\$BANNER(.*)/ ) { @@ -537,6 +547,7 @@ my $count = 0; foreach my $name ( @dirs ) { + $name = gnump3d::url::encodeEntities($name); $text .= "\n"; } $text .= "\n"; Index: templates/Tabular/index.html =================================================================== RCS file: /cvsroot/gnump3d/gnump3d/templates/Tabular/index.html,v retrieving revision 1.3 diff -u -r1.3 index.html --- templates/Tabular/index.html 27 Oct 2003 19:27:05 -0000 1.3 +++ templates/Tabular/index.html 2 Nov 2003 16:44:49 -0000 @@ -3,11 +3,6 @@ GNUMP3d :: $DIRECTORY - - - - -