MDL-49179 weblib: Secure the direct usage of $_SERVER['HTTP_REFERER']
This commit is contained in:
committed by
Mr. Jenkins (CiBoT)
parent
278cd8f20f
commit
7f426dd24f
@@ -78,8 +78,9 @@ if ($courseid) {
|
||||
}
|
||||
|
||||
// Return to previous page
|
||||
if (!empty($_SERVER['HTTP_REFERER'])) {
|
||||
redirect($_SERVER['HTTP_REFERER']);
|
||||
$referer = clean_param($_SERVER['HTTP_REFERER'], PARAM_LOCALURL);
|
||||
if (!empty($referer)) {
|
||||
redirect($referer);
|
||||
} else {
|
||||
redirect('view.php?id='.$course->id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user