From 5c703c83fd0e101c75ebd5da9fbca08f7b02de72 Mon Sep 17 00:00:00 2001 From: Dave Cooper Date: Mon, 19 Jan 2015 13:16:48 +0800 Subject: [PATCH] MDL-48776 core_message: Fixed userid check. Thanks to Oleg Demeshev for providing the patch. --- message/edit.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/message/edit.php b/message/edit.php index 8a498629229..7b73ec2686d 100644 --- a/message/edit.php +++ b/message/edit.php @@ -25,9 +25,13 @@ require_once(dirname(__FILE__) . '/../config.php'); require_once($CFG->dirroot . '/message/lib.php'); -$userid = optional_param('id', $USER->id, PARAM_INT); // user id +$userid = optional_param('id', 0, PARAM_INT); // User id. $disableall = optional_param('disableall', 0, PARAM_BOOL); //disable all of this user's notifications +if (!$userid) { + $userid = $USER->id; +} + $url = new moodle_url('/message/edit.php'); $url->param('id', $userid);