Commit 395afc5f authored by Aaron Wells's avatar Aaron Wells
Browse files

Leap2a: filter invalid XML chars on export (Bug 1482437)

behatnotneeded: Can't test contents of exported Leap2a files
in behat yet.

Change-Id: I4a309d0656e379432e3e9a62d9d4e6892980ab46
parent 7df8732e
......@@ -156,6 +156,10 @@ class PluginExportLeap extends PluginExport {
$this->export_footer();
$this->notify_progress_callback(90, get_string('writingfiles', 'export'));
// Filter invalid XML characters out of the final product
require_once('file.php');
$this->xml = preg_replace(xml_filter_regex(), '', $this->xml);
// write out xml to a file
if (!file_put_contents($this->exportdir . $this->leapfile, $this->xml)) {
$SESSION->add_error_msg(get_string('couldnotwriteLEAPdata', 'export'));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment