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

raeburn raeburn at source.lon-capa.org
Sun Dec 21 11:42:39 EST 2014


raeburn		Sun Dec 21 16:42:39 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	loncommon.pm 
  Log:
  - For 2.11
    - Backport 1.1203
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.82 loncom/interface/loncommon.pm:1.1075.2.83
--- loncom/interface/loncommon.pm:1.1075.2.82	Sat Aug 23 18:43:56 2014
+++ loncom/interface/loncommon.pm	Sun Dec 21 16:42:38 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1075.2.82 2014/08/23 18:43:56 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.83 2014/12/21 16:42:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7672,10 +7672,12 @@
         title = title.replace(/^LON-CAPA /,'');
     }
     title = encodeURIComponent(title);
+    title = title.replace("'","\\\'");
     if (!path) {
         path = location.pathname;
     }
     path = encodeURIComponent(path);
+    path = path.replace("'","\\\'");
     Win = window.open('/adm/wishlist?mode=newLink&setTitle='+title+'&setPath='+path,
                       'wishlistNewLink','width=560,height=350,scrollbars=0');
 }
@@ -7718,6 +7720,7 @@
 };
 	var openMyModal = function(source,width,height,scrolling,transparency,style)
 	{
+                source = source.replace("'","'");
 		modalWindow.windowId = "myModal";
 		modalWindow.width = width;
 		modalWindow.height = height;
@@ -14488,7 +14491,7 @@
     my ($url)   = @_;
     my @urlslices = split(/\//, $url,-1);
     my $lastitem = &escape(pop(@urlslices));
-    return join('/', at urlslices).'/'.$lastitem;
+    return &HTML::Entities::encode(join('/', at urlslices),"'").'/'.$lastitem;
 }
 
 sub compare_arrays {




More information about the LON-CAPA-cvs mailing list