[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Thu May 29 08:45:06 EDT 2014


raeburn		Thu May 29 12:45:06 2014 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Bug 6604
    - Modification so parameters will work in Authoring Space, following
      changes to address bug 1320. 
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1260 loncom/lonnet/perl/lonnet.pm:1.1261
--- loncom/lonnet/perl/lonnet.pm:1.1260	Sat May 10 14:00:04 2014
+++ loncom/lonnet/perl/lonnet.pm	Thu May 29 12:45:05 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1260 2014/05/10 14:00:04 raeburn Exp $
+# $Id: lonnet.pm,v 1.1261 2014/05/29 12:45:05 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -10223,7 +10223,7 @@
         ($uri =~ m|/$|) || ($uri =~ m|/.meta$|) || ($uri =~ m{^/*uploaded/.+\.sequence$})) {
 	return undef;
     }
-    if (($uri =~ /^priv/ || $uri=~/home\/httpd\/html\/priv/) 
+    if (($uri =~ /^priv/ || $uri=~m{^home/httpd/html/priv}) 
 	&& &Apache::lonxml::get_state('target') =~ /^(|meta)$/) {
 	return undef;
     }
@@ -11673,7 +11673,9 @@
 sub declutter {
     my $thisfn=shift;
     if ($thisfn=~m|^/enc/|) { $thisfn=&Apache::lonenc::unencrypted($thisfn); }
-    $thisfn=~s/^\Q$perlvar{'lonDocRoot'}\E//;
+    unless ($thisfn=~m{^/home/httpd/html/priv/}) {
+        $thisfn=~s{^/home/httpd/html}{};
+    }
     $thisfn=~s/^\///;
     $thisfn=~s|^adm/wrapper/||;
     $thisfn=~s|^adm/coursedocs/showdoc/||;
@@ -13642,7 +13644,8 @@
 
 =item *
 
-declutter() : declutters URLs (remove docroot, beginning slashes, 'res' etc)
+declutter() : declutters URLs -- remove beginning slashes, 'res' etc.
+also removes beginning /home/httpd/html unless /priv/ follows it.
 
 =back
 




More information about the LON-CAPA-cvs mailing list