[LON-CAPA-cvs] cvs: rat / map.pm

raeburn raeburn@source.lon-capa.org
Fri, 19 Dec 2008 03:49:56 -0000


raeburn		Fri Dec 19 03:49:56 2008 EDT

  Modified files:              
    /rat	map.pm 
  Log:
  - Regular Expressions for both http and https. 
  
  
Index: rat/map.pm
diff -u rat/map.pm:1.11 rat/map.pm:1.12
--- rat/map.pm:1.11	Thu Sep 11 14:47:24 2008
+++ rat/map.pm	Fri Dec 19 03:49:56 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # routines for modyfing .sequence and .page files
 #
-# $Id: map.pm,v 1.11 2008/09/11 14:47:24 bisitz Exp $
+# $Id: map.pm,v 1.12 2008/12/19 03:49:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -265,7 +265,7 @@
 		my $idx=&getresidx($url,$residx);
 		$insertorder[$#insertorder+1]=$idx;
 		my $ext='false';
-		if ($url=~/^http\:\/\//) { $ext='true'; }
+		if ($url=~/^https?\:\/\//) { $ext='true'; }
 		$url=~s/\:/\:/g;
 		$name=~s/\:/\:/g;
 		$resources[$idx]=$name.':'.$url.':'.$ext.':normal:res';
@@ -283,7 +283,7 @@
 # Remove all start and finish
     foreach (@order) {
 	my ($name,$url,$ext)=split(/\:/,$resources[$_]);
-        if ($url=~/http\&colon\:\/\//) { $ext='true'; }
+        if ($url=~/https?\&colon\:\/\//) { $ext='true'; }
         $resources[$_]=$name.':'.$url.':'.$ext.':normal:res';
     }
 # Garbage collection
@@ -357,7 +357,7 @@
 	    $output.='<&>objcont<:>'.$i.'<:>'.$zombies[$i];
         }
     }
-    $output=~s/http\&colon\;\/\///g;
+    $output=~s/https?\&colon\;\/\///g;
     $env{'form.output'}=$output;
     return &loadmap($fn,&savemap($fn,''));
 }
@@ -616,8 +616,8 @@
 			}
 			$comp[1].='" external="true';
 		    } else {
-			if ($comp[1]=~/^http\:\/\//) {
-			    $comp[1]=~s/^http\:\/\/[^\/]*\//\//;
+			if ($comp[1]=~/^https?\:\/\//) {
+			    $comp[1]=~s/^https?\:\/\/[^\/]*\//\//;
 			}
 		    }
 		    $outstr.='<resource id="'.$parts[1].'" src="'