MDL-64511 privacy: encode data URL when loading content.
authorPaul Holden <pholden@greenhead.ac.uk>
Wed, 27 Mar 2019 12:56:16 +0000 (12:56 +0000)
committerPaul Holden <pholden@greenhead.ac.uk>
Fri, 28 Jun 2019 12:16:16 +0000 (13:16 +0100)
Previously paths that included ? or # characters would break loading.

privacy/export_files/general.js

index b887861..11fe97c 100644 (file)
@@ -62,7 +62,7 @@ function loadContent(datafile, callback) {
     }
 
     newscript.type = 'text/javascript';
-    newscript.src = data;
+    newscript.src = encodeURIComponent(data);
     newscript.charset = 'utf-8';
     document.getElementsByTagName("head")[0].appendChild(newscript);
 
@@ -135,4 +135,4 @@ window.$(document).ready(function() {
         e.stopPropagation();
         handleClick(window.$(this));
     });
-});
\ No newline at end of file
+});