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

raeburn raeburn at source.lon-capa.org
Sat Apr 8 14:50:36 EDT 2017


raeburn		Sat Apr  8 18:50:36 2017 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - Use $ENV{'SERVER_NAME'} instead of $r->hostname() if no $r.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.529 loncom/interface/lonnavmaps.pm:1.530
--- loncom/interface/lonnavmaps.pm:1.529	Wed Mar  8 02:51:08 2017
+++ loncom/interface/lonnavmaps.pm	Sat Apr  8 18:50:35 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.529 2017/03/08 02:51:08 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.530 2017/04/08 18:50:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1691,7 +1691,11 @@
     my ($is_ssl,$cdom,$cnum,$hostname);
     if ($ENV{'SERVER_PORT'} == 443) {
         $is_ssl = 1;
-        $hostname = $r->hostname();
+        if ($r) {
+            $hostname = $r->hostname();
+        } else {
+            $hostname = $ENV{'SERVER_NAME'};
+        }
     }
     if ($env{'request.course.id'}) {
         $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};




More information about the LON-CAPA-cvs mailing list