From d1583d8e9cb779a5aa211229a2d879e2b7576fef Mon Sep 17 00:00:00 2001 From: David Monllao Date: Tue, 6 Oct 2015 11:39:39 +0800 Subject: [PATCH] MDL-51250 course: No function returns in empty() --- course/editsection_form.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/course/editsection_form.php b/course/editsection_form.php index f4a9df4a467..25055235b89 100644 --- a/course/editsection_form.php +++ b/course/editsection_form.php @@ -112,7 +112,8 @@ class editsection_form extends moodleform { $data = parent::get_data(); if ($data !== null) { $editoroptions = $this->_customdata['editoroptions']; - if (!empty($data->usedefaultname) || empty(trim($data->name))) { + $trimmedname = $data->name; + if (!empty($data->usedefaultname) || empty($trimmedname)) { $data->name = null; } $data = file_postupdate_standard_editor($data, 'summary', $editoroptions,