From bc739a0104f2660d3875c5f546c1a0f0c528d2b4 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 11 Apr 2006 13:10:30 +0000 Subject: [PATCH] Don't save empty comments --- mod/data/comment.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/data/comment.php b/mod/data/comment.php index a04d97720f..594caaf20f 100755 --- a/mod/data/comment.php +++ b/mod/data/comment.php @@ -39,6 +39,11 @@ } } + $commentcontent = trim($commentcontent); + if (empty($commentcontent)) { + redirect('view.php?rid='.$record->id.'&page='.$page, get_string('commentempty', 'data')); + } + switch ($mode) { case 'add': $newcomment = new object; -- 2.39.5