MDL-28030 setup: Ensure $CFG->urlrewriteclass is properly setup
(To avoid crippling a site)
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
cfdc1bb0ca
commit
cbce7be769
@@ -947,6 +947,17 @@ if ($USER && function_exists('apache_note')
|
||||
apache_note('MOODLEUSER', $logname);
|
||||
}
|
||||
|
||||
// Ensure the urlrewriteclass is setup correctly (to avoid crippling site).
|
||||
if (isset($CFG->urlrewriteclass)) {
|
||||
if (!class_exists($CFG->urlrewriteclass)) {
|
||||
debugging("urlrewriteclass {$CFG->urlrewriteclass} was not found, disabling.");
|
||||
unset($CFG->urlrewriteclass);
|
||||
} else if (!in_array('core\output\url_rewriter', class_implements($CFG->urlrewriteclass))) {
|
||||
debugging("{$CFG->urlrewriteclass} does not implement core\output\url_rewriter, disabling.", DEBUG_DEVELOPER);
|
||||
unset($CFG->urlrewriteclass);
|
||||
}
|
||||
}
|
||||
|
||||
// Use a custom script replacement if one exists
|
||||
if (!empty($CFG->customscripts)) {
|
||||
if (($customscript = custom_script_path()) !== false) {
|
||||
|
||||
Reference in New Issue
Block a user