4 * Jumps to a given relative or Moodle absolute URL.
5 * Mostly used for accessibility.
9 require('../config.php');
11 $jump = optional_param('jump', '', PARAM_RAW
);
13 if (!confirm_sesskey()) {
14 print_error('confirmsesskeybad');
17 if (strpos($jump, $CFG->wwwroot
) === 0) { // Anything on this site
18 redirect(urldecode($jump));
19 } else if (preg_match('/^[a-z]+\.php\?/', $jump)) {
20 redirect(urldecode($jump));
23 if (isset($_SERVER['HTTP_REFERER'])) {
24 redirect($_SERVER['HTTP_REFERER']); // Return to sender, just in case