2004-09-29 13:47:16 +00:00
|
|
|
<?php // $Id$
|
2005-11-16 16:47:17 +00:00
|
|
|
|
2004-09-29 13:47:16 +00:00
|
|
|
/*
|
2005-11-16 16:47:17 +00:00
|
|
|
* Jumps to a given relative or Moodle absolute URL.
|
|
|
|
* Mostly used for accessibility.
|
2004-09-29 13:47:16 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-10-01 12:09:52 +00:00
|
|
|
require('../config.php');
|
2004-09-29 13:47:16 +00:00
|
|
|
|
2005-11-16 16:47:17 +00:00
|
|
|
$jump = optional_param('jump', '', PARAM_RAW);
|
2004-09-29 13:47:16 +00:00
|
|
|
|
2006-09-11 06:47:38 +00:00
|
|
|
if (!confirm_sesskey()) {
|
|
|
|
print_error('confirmsesskeybad');
|
|
|
|
}
|
|
|
|
|
2005-11-17 06:40:12 +00:00
|
|
|
if (strpos($jump, $CFG->wwwroot) === 0) { // Anything on this site
|
|
|
|
redirect(urldecode($jump));
|
|
|
|
} else if (preg_match('/^[a-z]+\.php\?/', $jump)) {
|
2004-10-01 12:09:52 +00:00
|
|
|
redirect(urldecode($jump));
|
2005-11-16 16:47:17 +00:00
|
|
|
}
|
2004-09-29 13:47:16 +00:00
|
|
|
|
2005-11-17 06:40:12 +00:00
|
|
|
redirect($_SERVER['HTTP_REFERER']); // Return to sender, just in case
|
|
|
|
|
2004-09-29 13:47:16 +00:00
|
|
|
?>
|