From e7bf69e057a7c4bbaba16fd0fb2eabd308973028 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 17 Jun 2019 17:14:55 +0200 Subject: [PATCH] MDL-65469 mod_forum: Check for existence before operating --- mod/forum/post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/forum/post.php b/mod/forum/post.php index 0cf58cd62de..49af7e2ee96 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -789,11 +789,11 @@ if ($mformpost->no_submit_button_pressed()) { $data = $mformpost->get_submitted_data(); // If a no submit button has been pressed but the default values haven't been then reset the form change. - if (!$dirty && !empty(trim($data->message['text']))) { + if (!$dirty && isset($data->message['text']) && !empty(trim($data->message['text']))) { $dirty = true; } - if (!$dirty && !empty(trim($data->message['message']))) { + if (!$dirty && isset($data->message['message']) && !empty(trim($data->message['message']))) { $dirty = true; } }