--- loncom/publisher/lonpubdir.pm 2011/10/21 22:33:14 1.129
+++ loncom/publisher/lonpubdir.pm 2011/10/22 15:16:20 1.131
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construction Space Directory Lister
#
-# $Id: lonpubdir.pm,v 1.129 2011/10/21 22:33:14 www Exp $
+# $Id: lonpubdir.pm,v 1.131 2011/10/22 15:16:20 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -447,16 +447,14 @@ sub getSourceRightString {
sub putdirectory {
my ($r, $reqfile, $here, $dirname, $modtime, $resdir, $bombs, $numdir) = @_;
-#&Apache::lonnet::logthis("reqfile $reqfile here $here dirname $dirname resdir $resdir");
-
-
# construct the display filename: the directory name unless ..:
my $disfilename = $dirname;
if ($dirname eq '..') {
$disfilename = ''.&mt('Parent Directory').'';
}
- unless ( (($dirname eq '..') && ($reqfile eq '')) || ($dirname eq '.')) {
+# Don't display directory itself, and there is no way up from root directory
+ unless ( (($dirname eq '..') && ($reqfile=~/^\/[^\/]+\/[^\/]+$/)) || ($dirname eq '.')) {
my $kaputt=0;
foreach (keys %{$bombs}) {
if ($_=~m:^\Q$resdir\E/\Q$disfilename\E/:) { $kaputt=1; last; }
@@ -523,7 +521,7 @@ sub putresource {
my $title=' ';
my $publish_button=&mt('Publish');
my $cstr_dir = $r->dir_config('lonDocRoot').'/priv/'.$udom.'/'.$uname.'/'.$thisdisfn.'/';
- my $linkfilename='/priv'.$thisdisfn.'/'.$filename;
+ my $linkfilename=&HTML::Entities::encode('/priv'.$thisdisfn.'/'.$filename,'<>&"');
if (-e $resdir.'/'.$filename) {
my $same=0;
@@ -659,8 +657,8 @@ sub create_pubselect {
''.
''.
'
-
+
';
$$numres ++;