[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 26 May 2004 22:45:58 -0000


albertel		Wed May 26 18:45:58 2004 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  - more breakage with fun file names
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.175 loncom/homework/lonhomework.pm:1.176
--- loncom/homework/lonhomework.pm:1.175	Tue May 25 17:25:53 2004
+++ loncom/homework/lonhomework.pm	Wed May 26 18:45:57 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.175 2004/05/25 21:25:53 albertel Exp $
+# $Id: lonhomework.pm,v 1.176 2004/05/26 22:45:57 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -434,7 +434,7 @@
             <head><title>'.&mt("Analyzing a problem").'</title></head>
             <body bgcolor="#FFFFFF">'.&Apache::lonxml::message_location().'
             <form name="lonhomework" method="POST" action="'.
-	    $ENV{'request.uri'}.'">
+	    &HTML::Entities::encode($ENV{'request.uri'},'<>&"').'">
             <input type="submit" name="problemmode" value="'.&mt("EditXML").'" />
             <input type="submit" name="problemmode" value="'.&mt('Edit').'" />
             <hr />
@@ -554,7 +554,7 @@
 	$result.='<html><body bgcolor="#FFFFFF">'.
 	    &Apache::lonxml::message_location().'
             <form name="lonhomework" method="POST" action="'.
-	    $ENV{'request.uri'}.'">
+	    &HTML::Entities::encode($ENV{'request.uri'},'<>&"').'">
             <input type="hidden" name="problemmode" value="'.&mt('EditXML').'" />
             <input type="submit" name="problemmode" accesskey="d" value="'.&mt('Discard Edits and View').'" />
             <input type="submit" name="problemmode" accesskey="e" value="'.&mt('Edit').'" />
@@ -669,8 +669,8 @@
 	copy($templatefilename,$dest);
 	&renderpage($request,$dest);
     } else {
-	my $url=$request->uri;
-	my $shownurl=$url;
+	my $url=&HTML::Entities::encode($request->uri,'<>&"');
+	my $shownurl=$url;	
 	$shownurl=~s-^/~-/priv/-;
 	my $dest = &Apache::lonnet::filelocation("",$request->uri);
 	my $errormsg;
@@ -709,7 +709,7 @@
 
 sub view_or_edit_menu {
     my ($request) = @_;
-    my $url=$request->uri;
+    my $url=&HTML::Entities::encode($request->uri,'<>&"');
     my %lt=&Apache::lonlocal::texthash( 'would' => 'Would you like to',
 		      'view' => 'View',
 		      'Edit' => 'edit',