[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm
foxr
lon-capa-cvs@mail.lon-capa.org
Mon, 31 Jul 2006 21:53:46 -0000
foxr Mon Jul 31 17:53:46 2006 EDT
Modified files:
/loncom/interface lonmenu.pm
Log:
Bug 4038 - Escape apostrophes within apostrophe quited arguments to
javascript subs to prevent syntax errors.
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.199 loncom/interface/lonmenu.pm:1.200
--- loncom/interface/lonmenu.pm:1.199 Wed Jul 19 06:52:27 2006
+++ loncom/interface/lonmenu.pm Mon Jul 31 17:53:45 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.199 2006/07/19 10:52:27 albertel Exp $
+# $Id: lonmenu.pm,v 1.200 2006/07/31 21:53:45 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -461,12 +461,14 @@
$is_const_dir = 1;
} else {
$currdir =~ s#[^/]+$##;
+ my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn);
+ &Apache::lonnet::logthis("thisdisfn = $thisdisfn cleaned: $cleandisfn");
$menuitems=(<<ENDMENUITEMS);
s&6&1&list.gif&list[_1]&dir[_1]&golist('$currdir')&List current directory
-s&6&2&rtrv.gif&retrieve[_1]&version[_1]&gocstr('/adm/retrieve','/~$uname/$thisdisfn')&Retrieve old version
-s&6&3&pub.gif&publish[_1]&resource[_1]&gocstr('/adm/publish','/~$uname/$thisdisfn')&Publish this resource
-s&7&1&del.gif&delete[_1]&resource[_2]&gocstr('/adm/cfile?action=delete','/~$uname/$thisdisfn')&Delete this resource
-s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document
+s&6&2&rtrv.gif&retrieve[_1]&version[_1]&gocstr('/adm/retrieve','/~$uname/$cleandisfn')&Retrieve old version
+s&6&3&pub.gif&publish[_1]&resource[_1]&gocstr('/adm/publish','/~$uname/$cleandisfn')&Publish this resource
+s&7&1&del.gif&delete[_1]&resource[_2]&gocstr('/adm/cfile?action=delete','/~$uname/$cleandisfn')&Delete this resource
+s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$cleandisfn')&Prepare a printable document
ENDMENUITEMS
}
} elsif (defined($env{'request.course.id'}) &&