mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
22 lines
497 B
PHP
22 lines
497 B
PHP
<?php // $Id$
|
|
|
|
/*
|
|
* Jumps to a given relative or Moodle absolute URL.
|
|
* Mostly used for accessibility.
|
|
*
|
|
*/
|
|
|
|
require('../config.php');
|
|
|
|
$jump = optional_param('jump', '', PARAM_RAW);
|
|
|
|
if (strpos($jump, $CFG->wwwroot) === 0) { // Anything on this site
|
|
redirect(urldecode($jump));
|
|
} else if (preg_match('/^[a-z]+\.php\?/', $jump)) {
|
|
redirect(urldecode($jump));
|
|
}
|
|
|
|
redirect($_SERVER['HTTP_REFERER']); // Return to sender, just in case
|
|
|
|
?>
|