MDL-29311 messaging: added a safety check to prevent message refreshing causing inadvertant DOS

This commit is contained in:
Andrew Davis (andyjdavis)
2011-09-19 13:45:10 +08:00
committed by Aparup Banerjee
parent 5f4d14ebbe
commit 97f258fabb
+6
View File
@@ -19,6 +19,12 @@
$userfullname = strip_tags(required_param('name', PARAM_RAW));
$wait = optional_param('wait', MESSAGE_DEFAULT_REFRESH, PARAM_INT);
if ($wait < 1) {
//this should not happen unless someone is manually constructing URLs
//allowing a wait of 0 causes continuous GET requests
$wait = MESSAGE_DEFAULT_REFRESH;
}
$stylesheetshtml = '';
foreach ($CFG->stylesheets as $stylesheet) {
$stylesheetshtml .= '<link rel="stylesheet" type="text/css" href="'.$stylesheet.'" />';