This commit is contained in:
Sara Arjona 2022-10-24 15:47:21 +02:00
commit 4cf81fd3c2

View file

@ -145,9 +145,11 @@ abstract class convert_helper {
$firstchars = fread($handle, 200);
$status = fclose($handle);
if (strpos($firstchars,'<?xml version="1.0" encoding="UTF-8"?>') !== false and
strpos($firstchars,'<moodle_backup>') !== false and
// Look for expected XML elements (case-insensitive to account for encoding attribute).
if (stripos($firstchars, '<?xml version="1.0" encoding="UTF-8"?>') !== false &&
strpos($firstchars, '<moodle_backup>') !== false &&
strpos($firstchars, '<information>') !== false) {
return true;
}