diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 708c596ac98..60b33b2a4f3 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -1677,6 +1677,12 @@ function error ($message, $link='') { } } + // when printing an error the continue button should never link offsite + if (stripos($link, $CFG->wwwroot) === false && + stripos($link, $CFG->httpswwwroot) === false) { + $link = $CFG->wwwroot.'/'; + } + if (!empty($link)) { print_continue($link); } diff --git a/lib/weblib.php b/lib/weblib.php index 9b57dbb7246..51bb5da7138 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -5841,6 +5841,12 @@ function print_error($errorcode, $module='error', $link='', $a=NULL, $extralocat } } + // when printing an error the continue button should never link offsite + if (stripos($link, $CFG->wwwroot) === false && + stripos($link, $CFG->httpswwwroot) === false) { + $link = $CFG->wwwroot.'/'; + } + if (!empty($CFG->errordocroot)) { $errordoclink = $CFG->errordocroot.'/en'; } else {