Fixed a notice when no REFERER was present
This commit is contained in:
+7
-3
@@ -180,12 +180,16 @@ function addslashes_js($var) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL of the HTTP_REFERER, less the querystring portion
|
||||
* Returns the URL of the HTTP_REFERER, less the querystring portion if required
|
||||
* @return string
|
||||
*/
|
||||
function get_referer() {
|
||||
function get_referer($stripquery=true) {
|
||||
if (isset($_SERVER['HTTP_REFERER'])) {
|
||||
return strip_querystring($_SERVER['HTTP_REFERER']);
|
||||
if ($stripquery) {
|
||||
return strip_querystring($_SERVER['HTTP_REFERER']);
|
||||
} else {
|
||||
return $_SERVER['HTTP_REFERER'];
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@
|
||||
'', '', true, "", navmenu($course, $cm));
|
||||
}
|
||||
notice_yesno(get_string('noguestpost', 'forum').'<br /><br />'.get_string('liketologin'),
|
||||
$wwwroot, $_SERVER['HTTP_REFERER']);
|
||||
$wwwroot, get_referer(false));
|
||||
print_footer($course);
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user