File: index.php
Line: 57
Affected Moodle version: 4.4+
The deprecated function get_system_context() is still being used in index.php with a version check:
if ($CFG->branch >= 25) { // Moodle 2.5+.
$context = context_system::instance();
} else {
$context = get_system_context();
}
This condition is now outdated and unsafe:
- Moodle 2.5 is no longer supported.
- get_system_context() has been entirely removed, and will now throw a fatal exception in Moodle 4.4+.
Suggested fix
Simplify the conditional logic by removing the legacy fallback:
$context = context_system::instance();
No version check is required anymore.
File: index.php
Line: 57
Affected Moodle version: 4.4+
The deprecated function get_system_context() is still being used in index.php with a version check:
This condition is now outdated and unsafe:
Suggested fix
Simplify the conditional logic by removing the legacy fallback:
$context = context_system::instance();No version check is required anymore.