From fb13d3a118c64481622485dba1a7c0eb4d5643af Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Mon, 10 Feb 2020 16:55:11 +0800 Subject: [PATCH] MDL-66245 privacy: Encode each part of the data URL instead of the whole --- privacy/export_files/general.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/privacy/export_files/general.js b/privacy/export_files/general.js index 11fe97ccf86..2e661660586 100644 --- a/privacy/export_files/general.js +++ b/privacy/export_files/general.js @@ -62,7 +62,11 @@ function loadContent(datafile, callback) { } newscript.type = 'text/javascript'; - newscript.src = encodeURIComponent(data); + var dataParts = data.split('/'); + dataParts.forEach(function(part, index) { + this[index] = encodeURIComponent(part); + }, dataParts); + newscript.src = dataParts.join('/'); newscript.charset = 'utf-8'; document.getElementsByTagName("head")[0].appendChild(newscript);