MDL-27464 continuation link sometimes links off-site
authorPetr Skoda <commits@skodak.org>
Sat, 23 Jul 2011 11:25:39 +0000 (13:25 +0200)
committerPetr Skoda <commits@skodak.org>
Sat, 23 Jul 2011 11:28:43 +0000 (13:28 +0200)
This code was manually merged from MOODLE_19_STABLE, credit goes to Matt Meisberger.

lib/setuplib.php

index aeae850..8d724b0 100644 (file)
@@ -501,6 +501,12 @@ function get_exception_info($ex) {
         }
     }
 
+    // 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.'/';
+    }
+
     $info = new stdClass();
     $info->message     = $message;
     $info->errorcode   = $errorcode;