mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-73030 backup: case-insensitive detection of Moodle backups.
This commit is contained in:
parent
24f97edd91
commit
65f9976478
1 changed files with 5 additions and 3 deletions
|
@ -145,9 +145,11 @@ abstract class convert_helper {
|
||||||
$firstchars = fread($handle, 200);
|
$firstchars = fread($handle, 200);
|
||||||
$status = fclose($handle);
|
$status = fclose($handle);
|
||||||
|
|
||||||
if (strpos($firstchars,'<?xml version="1.0" encoding="UTF-8"?>') !== false and
|
// Look for expected XML elements (case-insensitive to account for encoding attribute).
|
||||||
strpos($firstchars,'<moodle_backup>') !== false and
|
if (stripos($firstchars, '<?xml version="1.0" encoding="UTF-8"?>') !== false &&
|
||||||
|
strpos($firstchars, '<moodle_backup>') !== false &&
|
||||||
strpos($firstchars, '<information>') !== false) {
|
strpos($firstchars, '<information>') !== false) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue