Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6815

Re: Moodle 4.2 : Backups (CLI and GUI) not working (htmlspecialchars error message))

$
0
0
by Jens Prymelski.  

Hi.

Sorry for the late reply.

The problem occurs, because an array is provided to the htmlspecialchars() function within the xml_safe_text_content() function in the backup/util/xml/xml_writer.class.php file, which is not accepted.

The hotfix we use is to change the xml_safe_text_content function to accept an array as argument and implode() it.

Related file: <moodle_root_dir>/backup/util/xml/xml_writer.class.php

Function to change: protected function xml_safe_text_content($content) {...}

Content of the changed function:
protected function xml_safe_text_content($content) {
if (gettype($content) === 'array') {
$content = implode('', $content);
}

return htmlspecialchars($this->xml_safe_utf8($content), ENT_NOQUOTES);
}

Have a nice day,
Jens

Viewing all articles
Browse latest Browse all 6815

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>