[LON-CAPA-cvs] cvs: loncom /publisher loncfile.pm lonconstruct.pm lonupload.pm
foxr
lon-capa-cvs@mail.lon-capa.org
Tue, 10 Sep 2002 02:31:27 -0000
foxr Mon Sep 9 22:31:27 2002 EDT
Modified files:
/loncom/publisher loncfile.pm lonconstruct.pm lonupload.pm
Log:
Correct ad hoc mapping of urls to use HTTP::Entities::encode.
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.17 loncom/publisher/loncfile.pm:1.18
--- loncom/publisher/loncfile.pm:1.17 Mon Sep 2 16:06:57 2002
+++ loncom/publisher/loncfile.pm Mon Sep 9 22:31:26 2002
@@ -10,7 +10,7 @@
#
#
-# $Id: loncfile.pm,v 1.17 2002/09/02 20:06:57 harris41 Exp $
+# $Id: loncfile.pm,v 1.18 2002/09/10 02:31:26 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -88,6 +88,7 @@
use Apache::File;
use File::Basename;
use File::Copy;
+use HTML::Entities();
use Apache::Constants qw(:common :http :methods);
use Apache::loncacc;
use Apache::Log ();
@@ -1019,9 +1020,9 @@
$dest =~ s/\/home\//\/priv\//;
$dest =~ s/\/public_html//;
- my $base = &Apache::lonnet::escape(&File::Basename::basename($dest));
+ my $base = &File::Basename::basename($dest);
my $dpath= &File::Basename::dirname($dest);
- $dest = $dpath.'/'.$base;
+ $dest = &HTML::Entities::encode($dpath.'/'.$base);
&Debug($r, "Final url after rewrite: $dest");
Index: loncom/publisher/lonconstruct.pm
diff -u loncom/publisher/lonconstruct.pm:1.7 loncom/publisher/lonconstruct.pm:1.8
--- loncom/publisher/lonconstruct.pm:1.7 Fri Aug 23 23:56:58 2002
+++ loncom/publisher/lonconstruct.pm Mon Sep 9 22:31:26 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construction Space Page Wrapper for Construction
#
-# $Id: lonconstruct.pm,v 1.7 2002/08/24 03:56:58 foxr Exp $
+# $Id: lonconstruct.pm,v 1.8 2002/09/10 02:31:26 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -43,7 +43,7 @@
use Apache::Constants qw(:common :http :methods);
use Apache::lonnet;
use Apache::Log ();
-
+use HTML::Entities();
my $DEBUG = 0;
=pod
@@ -103,7 +103,7 @@
&Debug($r, "Initial URL for lower frame: ".$lowerframe);
$lowerframe=~s/^\//\/\~/;
&Debug($r, "Lower frame URL afer ~ subst: ".$lowerframe);
- $lowerframe=~s/\"/"\;/g;
+ $lowerframe= &HTML::Entities::encode($lowerframe);
&Debug($r, "LOwer frame URL after quote subst: ".$lowerframe);
$r->print(<<ENDPAGE);
Index: loncom/publisher/lonupload.pm
diff -u loncom/publisher/lonupload.pm:1.13 loncom/publisher/lonupload.pm:1.14
--- loncom/publisher/lonupload.pm:1.13 Fri Aug 23 23:56:58 2002
+++ loncom/publisher/lonupload.pm Mon Sep 9 22:31:26 2002
@@ -2,7 +2,7 @@
# The LearningOnline Network with CAPA
# Handler to upload files into construction space
#
-# $Id: lonupload.pm,v 1.13 2002/08/24 03:56:58 foxr Exp $
+# $Id: lonupload.pm,v 1.14 2002/09/10 02:31:26 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -59,6 +59,7 @@
use Apache::loncommon();
use Apache::Log();
use Apache::lonnet;
+use HTML::Entities();
my $DEBUG=0;
@@ -159,7 +160,7 @@
# target is the full filesystem path of the destination file.
my $base = &File::Basename::basename($fn);
my $path = &File::Basename::dirname($fn);
- $base = Apache::lonnet::escape($base);
+ $base = &HTML::Entities::encode($base);
my $url = $path."/".$base;
&Debug($r, "URL is now ".$url);
my $datatoken=$ENV{'form.datatoken'};