From fa6b1a8d43ea63800aa6fb8cf2732ab5171f8d9c Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sat, 3 Dec 2022 23:02:36 +0100 Subject: [PATCH] Do no save empty comment or description --- include/class/follow_up.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/class/follow_up.class.php b/include/class/follow_up.class.php index ec89f1955..7fa5c4dee 100644 --- a/include/class/follow_up.class.php +++ b/include/class/follow_up.class.php @@ -1024,8 +1024,16 @@ class Follow_Up $this->ag_dest=$http->extract("ag_dest","string",$g_user->get_profile()); $this->ag_priority=$http->extract("ag_priority","string","2"); $this->ag_contact=$http->extract("ag_contact","string",""); - $this->ag_comment=$http->extract("ag_comment","raw",""); - $this->ag_description=$http->extract("ag_description","raw",""); + $ag_comment=trim($http->extract("ag_comment","raw","")); + if ( strip_tags($ag_comment) == '') + $this->ag_comment=''; + else + $this->ag_comment=$ag_comment; + $ag_description=trim($http->extract("ag_description","raw","")); + if ( strip_tags($ag_description) == '') + $this->ag_description=''; + else + $this->ag_description=$ag_description; $this->ag_remind_date=$http->extract("ag_remind_date","string",null); $this->operation=$http->extract("operation","string",null); $this->action=$http->extract("action","string",null);