From 8f9f666c902cb30ef6f519353f38c45a29fdf4a6 Mon Sep 17 00:00:00 2001 From: Matt Meisberger Date: Sat, 23 Jul 2011 13:21:14 +0200 Subject: [PATCH] MDL-27464 continuation link sometimes links off-site Integrating #CSTAGE-656, continuation link sometimes links off-site, into trunk. --- lib/deprecatedlib.php | 6 ++++++ lib/weblib.php | 6 ++++++ 2 files changed, 12 insertions(+) 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 {