[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm
foxr
lon-capa-cvs@mail.lon-capa.org
Thu, 21 Oct 2004 11:18:07 -0000
foxr Thu Oct 21 07:18:07 2004 EDT
Modified files:
/loncom/interface lonhtmlcommon.pm
Log:
Did a bit of quoting..specifically helped out the Recently used list
when the items in the list have special characters by escape_url-ing them.
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.93 loncom/interface/lonhtmlcommon.pm:1.94
--- loncom/interface/lonhtmlcommon.pm:1.93 Tue Oct 12 19:26:48 2004
+++ loncom/interface/lonhtmlcommon.pm Thu Oct 21 07:18:06 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.93 2004/10/12 23:26:48 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.94 2004/10/21 11:18:06 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -131,7 +131,8 @@
">\n<option value=''>--- ".&mt('Recent')." ---</option>";
foreach (sort keys %recent) {
unless ($_=~/^error\:/) {
- $return.="\n<option value='$_'>".
+ my $escaped = &Apache::loncommon::escape_url($_);
+ $return.="\n<option value='$escaped'>".
&Apache::lonnet::unescape((split(/\&/,$recent{$_}))[1]).
'</option>';
}
@@ -887,9 +888,12 @@
unless ($path eq $uri) { $path.='/'; }
my $linkpath=$path;
if ($form) {
- $linkpath="javascript:$form.action='$path';$form.submit();";
+ my $escaped_path = &Apache::loncommon::escape_single($path);
+ $linkpath="javascript:$form.action='$escaped_path';$form.submit();";
}
- $output.='<a href="'.$linkpath.'"'.($target?' target="'.$target.'"':'').'>'.$_.'</a>/';
+ my $escaped_linkpath = &Apache::loncommon::escape_single($linkpath);
+ my $escaped_target = &Apache::loncommon::escape_single($target);
+ $output.='<a href="'.$escaped_linkpath.'"'.($target?' target="'.$escaped_target.'"':'').'>'.$_.'</a>/';
}
} else {
$output.=$uri;