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

raeburn raeburn at source.lon-capa.org
Wed Feb 10 07:09:29 EST 2021


raeburn		Wed Feb 10 12:09:29 2021 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - In javascript use encodeURIComponent() instead of escape() for unicode.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.675 loncom/interface/londocs.pm:1.676
--- loncom/interface/londocs.pm:1.675	Tue Feb  9 22:12:33 2021
+++ loncom/interface/londocs.pm	Wed Feb 10 12:09:29 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.675 2021/02/09 22:12:33 raeburn Exp $
+# $Id: londocs.pm,v 1.676 2021/02/10 12:09:29 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7361,7 +7361,7 @@
 function makenewfolder(targetform,folderseq) {
     var foldername=prompt('$js_lt{"p_mnf"}','$js_lt{"t_mnf"}');
     if (foldername) {
-       targetform.importdetail.value=escape(foldername)+"="+folderseq;
+       targetform.importdetail.value=encodeURIComponent(foldername)+"="+folderseq;
         targetform.submit();
     }
 }
@@ -7369,7 +7369,7 @@
 function makenewpage(targetform,folderseq) {
     var pagename=prompt('$js_lt{"p_mnp"}','$js_lt{"t_mnp"}');
     if (pagename) {
-        targetform.importdetail.value=escape(pagename)+"="+folderseq;
+        targetform.importdetail.value=encodeURIComponent(pagename)+"="+folderseq;
         targetform.submit();
     }
 }
@@ -7378,7 +7378,7 @@
    var title=prompt('$js_lt{"p_mxu"}');
    if (title) {
     this.document.forms.newexamupload.importdetail.value=
-	escape(title)+'=/res/lib/templates/examupload.problem';
+	encodeURIComponent(title)+'=/res/lib/templates/examupload.problem';
     this.document.forms.newexamupload.submit();
    }
 }
@@ -7387,7 +7387,7 @@
    var title=prompt('$js_lt{"p_msp"}');
    if (title) {
     this.document.forms.newsmppg.importdetail.value=
-	escape(title)+'=/adm/$udom/$uname/new/smppg';
+	encodeURIComponent(title)+'=/adm/$udom/$uname/new/smppg';
     this.document.forms.newsmppg.submit();
    }
 }
@@ -7411,7 +7411,7 @@
    var title=prompt('$js_lt{"p_msb"}');
    if (title) {
     this.document.forms.newsmpproblem.importdetail.value=
-	escape(title)+'=/res/lib/templates/simpleproblem.problem';
+	encodeURIComponent(title)+'=/res/lib/templates/simpleproblem.problem';
     this.document.forms.newsmpproblem.submit();
    }
 }
@@ -7420,7 +7420,7 @@
    var title=prompt('$js_lt{"p_mdb"}');
    if (title) {
     this.document.forms.newdropbox.importdetail.value=
-        escape(title)+'=/res/lib/templates/DropBox.problem';
+        encodeURIComponent(title)+'=/res/lib/templates/DropBox.problem';
     this.document.forms.newdropbox.submit();
    }
 }
@@ -7429,7 +7429,7 @@
    var title=prompt('$js_lt{"p_mbb"}');
    if (title) {
     this.document.forms.newbul.importdetail.value=
-	escape(title)+'=/adm/$udom/$uname/new/bulletinboard';
+	encodeURIComponent(title)+'=/adm/$udom/$uname/new/bulletinboard';
     this.document.forms.newbul.submit();
    }
 }
@@ -8553,7 +8553,7 @@
         url += fname;
     }
     var title = document.crsresimportform.crsrestitle.value;
-    document.crsresimportform.importdetail.value=escape(title)+'='+escape(url);
+    document.crsresimportform.importdetail.value=encodeURIComponent(title)+'='+encodeURIComponent(url);
     return true;
 }
 




More information about the LON-CAPA-cvs mailing list