weblib MDL-6820 Reverted modification due to unforseen regressions
[moodle.git] / course / jumpto.php
blob50d88a53ca949a4e4580c9feb721bcf62b2c0c6b
1 <?php // $Id$
3 /*
4 * Jumps to a given relative or Moodle absolute URL.
5 * Mostly used for accessibility.
7 */
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