--- loncom/interface/lonindexer.pm 2002/05/09 23:01:41 1.41
+++ loncom/interface/lonindexer.pm 2002/06/20 21:22:20 1.44
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.41 2002/05/09 23:01:41 www Exp $
+# $Id: lonindexer.pm,v 1.44 2002/06/20 21:22:20 ng Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -81,7 +81,7 @@ my $fnum; # file counter
my $dnum; # directory counter
# ----- Used to include or exclude files with certain extensions.
-my @Only = ();
+my @Only = ();
my @Omit = ();
@@ -95,6 +95,11 @@ sub handler {
$dnum=0;
untie %hash;
+ # Deal with stupid global variables (is there a way around making
+ # these global to this package? It is just so wrong....)
+ undef (@Only);
+ undef (@Omit);
+
# ------------------------------------- read in machine configuration variables
my $iconpath= $r->dir_config('lonIconsURL') . "/";
my $domain = $r->dir_config('lonDefDomain');
@@ -127,8 +132,7 @@ sub handler {
if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) {
if ($ENV{'form.launch'} eq '1') {
&start_fresh_session();
- }
-
+ }
# -------------------- refresh environment with user database values (in %hash)
if ($hash{'mode_catalog'} eq 'interactive') {
$ENV{'form.catalogmode'}='interactive';
@@ -375,7 +379,7 @@ ENDHEADER
# ---------------------------------------------------------------- output title
$r->print(
-'
The LearningOnline Network with CAPA '.
+'The LearningOnline Network with CAPA '.
'Network Directory Browser
'."\n");
# ---------------------------------- get state of file attributes to be showing
if ($ENV{'form.attrs'} ne "") {
@@ -421,7 +425,7 @@ END
# $r->print(&initdebug());
# $r->print(&writedebug("Omit:@Omit")) if (@Omit);
# $r->print(&writedebug("Only:@Only")) if (@Only);
- $r->print("\n");
+ $r->print("\n");
$r->print("\n");
$r->print("Name | \n");
$r->print("Size (bytes) ".
@@ -743,8 +747,8 @@ sub display_line {
$title = &Apache::lonnet::metadata($filelink,'title')
if ($metafile == 1);
$title=$listname unless $title;
- my $titleesc=$title;
- $titleesc=~s/\'/\\'/; #' (clean up this spare quote
+ my $titleesc=HTML::Entities::encode($title);
+ $titleesc=~s/\'/\\'/; #' (clean up this spare quote)
$r->print("");
$r->print("".
@@ -756,6 +760,7 @@ sub display_line {
$title = &Apache::lonnet::metadata($filelink,'title')
if ($metafile == 1);
$title=$listname unless $title;
+ my $titleesc=&HTML::Entities::encode($title);
$r->print("\n");
$r->print(" | ");
$hash{"pre_${fnum}_link"}=$filelink;
- $hash{"pre_${fnum}_title"}=$title;
+ $hash{"pre_${fnum}_title"}=$titleesc;
$fnum++;
}
|
|
|