[LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 24 Jun 2003 23:24:48 -0000


albertel		Tue Jun 24 19:24:48 2003 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  - the first one of these fixes BUG #1669, the rest of these I did cause I of BUG#1669
  
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.121 loncom/publisher/lonpublisher.pm:1.122
--- loncom/publisher/lonpublisher.pm:1.121	Tue Apr  1 21:17:10 2003
+++ loncom/publisher/lonpublisher.pm	Tue Jun 24 19:24:48 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.121 2003/04/02 02:17:10 www Exp $
+# $Id: lonpublisher.pm,v 1.122 2003/06/24 23:24:48 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -190,7 +190,7 @@
               }
               if ($metadatafields{$unikey}) {
 		  my $newentry=$parser->get_text('/'.$entry);
-                  unless (($metadatafields{$unikey}=~/$newentry/) ||
+                  unless (($metadatafields{$unikey}=~/\Q$newentry\E/) ||
                           ($newentry eq '')) {
                      $metadatafields{$unikey}.=', '.$newentry;
 		  }
@@ -911,7 +911,7 @@
 # ------------------------------------------------ Check out directory hierachy
 
         my $thisdisfn=$source;
-        $thisdisfn=~s/^\/home\/$cuname\///;
+        $thisdisfn=~s/^\/home\/\Q$cuname\E\///;
 
         my @urlparts=split(/\//,$thisdisfn);
         $#urlparts--;
@@ -1054,7 +1054,7 @@
 	foreach (sort keys %keywords) {
 	    $keywordout.='<td><input type="checkbox" name="keywords" value="'.$_.'"';
 	    if ($metadatafields{'keywords'}) {
-		if ($metadatafields{'keywords'}=~/$_/) {
+		if ($metadatafields{'keywords'}=~/\Q$_\E/) {
 		    $keywordout.=' checked="on"';
 		}
 	    } elsif (&Apache::loncommon::keyword($_)) {
@@ -1144,7 +1144,7 @@
 	$ENV{'form.keywords'}='';
 	foreach (keys %keywords) {
 	    if ($metadatafields{'keywords'}) {
-		if ($metadatafields{'keywords'}=~/$_/) { 
+		if ($metadatafields{'keywords'}=~/\Q$_\E/) { 
 		    $ENV{'form.keywords'}.=$_.','; 
 		}
 	    } elsif (&Apache::loncommon::keyword($_)) {
@@ -1435,7 +1435,7 @@
 # ------------------------------------------------ Provide link to new resource
     unless ($batch) {
         my $thisdistarget=$target;
-        $thisdistarget=~s/^$docroot//;
+        $thisdistarget=~s/^\Q$docroot\E//;
         
         my $thissrc=$source;
         $thissrc=~s/^\/home\/(\w+)\/public_html/\/priv\/$1/;
@@ -1465,7 +1465,7 @@
 
     my $docroot=$r->dir_config('lonDocRoot');
     my $thisdistarget=$targetfile;
-    $thisdistarget=~s/^$docroot//;
+    $thisdistarget=~s/^\Q$docroot\E//;
 
 
     undef %metadatafields;
@@ -1702,10 +1702,10 @@
   $thistarget=~s/\/public\_html//;
 
   my $thisdistarget=$thistarget;
-  $thisdistarget=~s/^$docroot//;
+  $thisdistarget=~s/^\Q$docroot\E//;
 
   my $thisdisfn=$thisfn;
-  $thisdisfn=~s/^\/home\/$cuname\/public_html\///;
+  $thisdisfn=~s/^\/home\/\Q$cuname\E\/public_html\///;
 
   if ($fn=~/\/$/) {
 # -------------------------------------------------------- This is a directory