[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

raeburn raeburn@source.lon-capa.org
Fri, 19 Dec 2008 17:19:48 -0000


raeburn		Fri Dec 19 17:19:48 2008 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - Regular Expressions for both http and https.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.725 loncom/interface/loncommon.pm:1.726
--- loncom/interface/loncommon.pm:1.725	Fri Dec 19 00:13:51 2008
+++ loncom/interface/loncommon.pm	Fri Dec 19 17:19:48 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.725 2008/12/19 00:13:51 raeburn Exp $
+# $Id: loncommon.pm,v 1.726 2008/12/19 17:19:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3168,7 +3168,7 @@
     }
     $thisdir=~s-/[^/]*$--;
     foreach my $link (@rlinks) {
-	unless (($link=~/^http:\/\//i) ||
+	unless (($link=~/^https?\:\/\//i) ||
 		($link=~/^\//) ||
 		($link=~/^javascript:/i) ||
 		($link=~/^mailto:/i) ||
@@ -9870,7 +9870,7 @@
 # --- Get the symbolic name of a problem and the url
 sub get_symb {
     my ($request,$silent) = @_;
-    (my $url=$env{'form.url'}) =~ s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
+    (my $url=$env{'form.url'}) =~ s-^https?\://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
     my $symb=($env{'form.symb'} ne '' ? $env{'form.symb'} : (&Apache::lonnet::symbread($url)));
     if ($symb eq '') {
         if (!$silent) {