mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Merge branch 'MDL-73030' of https://github.com/paulholden/moodle
This commit is contained in:
commit
4cf81fd3c2
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
strpos($firstchars,'<information>') !== false) {
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue