Permalink
Browse files

Fix the submission of null entries when using the HTML editor.

  • Loading branch information...
1 parent e8f9933 commit db3e1a89f10ded5d5321f03accab65903e0409f2 rkingdon committed Jun 24, 2004
Showing with 9 additions and 3 deletions.
  1. +9 −3 mod/dialogue/dialogues.php
View
@@ -131,7 +131,11 @@
if ($conversations = dialogue_get_conversations($dialogue, $USER, "closed = 0")) {
foreach ($conversations as $conversation) {
$textarea_name = "reply$conversation->id";
- if (!empty($_POST[$textarea_name])) {
+ $stripped_text = '';
+ if (isset($_POST[$textarea_name])) {
+ $stripped_text = strip_tags(trim($_POST[$textarea_name]));
+ }
+ if ($stripped_text) {
unset($item);
$item->dialogueid = $dialogue->id;
$item->conversationid = $conversation->id;
@@ -179,9 +183,11 @@
if ($_POST['recipientid'] == 0) {
redirect("view.php?id=$cm->id", get_string("nopersonchosen", "dialogue"));
- } elseif (empty($_POST['firstentry'])) {
- redirect("view.php?id=$cm->id", get_string("notextentered", "dialogue"));
} else {
+ $stripped_text = strip_tags(trim($_POST['firstentry']));
+ if (!$stripped_text) {
+ redirect("view.php?id=$cm->id", get_string("notextentered", "dialogue"));
+ }
$conversation->dialogueid = $dialogue->id;
$conversation->userid = $USER->id;
$conversation->recipientid = $_POST['recipientid'];

0 comments on commit db3e1a8

Please sign in to comment.