X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=d431668b94e072822d6a653c2c276e1f4144047f;hb=f84c696925467f4091a6ac2e27f97d6a921c1643;hp=7324840a0e3acb4d1183246dd673416f27e9a960;hpb=606b0257ffee320419266ecf7a58e3bc1e8a7e62;p=friendica.git diff --git a/mod/message.php b/mod/message.php index 7324840a0e..d431668b94 100644 --- a/mod/message.php +++ b/mod/message.php @@ -70,10 +70,10 @@ function message_post(App $a) return; } - $replyto = !empty($_REQUEST['replyto']) ? Strings::escapeTags(trim($_REQUEST['replyto'])) : ''; - $subject = !empty($_REQUEST['subject']) ? Strings::escapeTags(trim($_REQUEST['subject'])) : ''; - $body = !empty($_REQUEST['body']) ? Strings::escapeHtml(trim($_REQUEST['body'])) : ''; - $recipient = !empty($_REQUEST['recipient']) ? intval($_REQUEST['recipient']) : 0; + $replyto = !empty($_REQUEST['replyto']) ? trim($_REQUEST['replyto']) : ''; + $subject = !empty($_REQUEST['subject']) ? trim($_REQUEST['subject']) : ''; + $body = !empty($_REQUEST['body']) ? Strings::escapeHtml(trim($_REQUEST['body'])) : ''; + $recipient = !empty($_REQUEST['recipient']) ? intval($_REQUEST['recipient']) : 0; $ret = Mail::send($recipient, $body, $subject, $replyto); $norecip = false; @@ -212,14 +212,7 @@ function message_content(App $a) $o .= $header; - $total = 0; - $r = q("SELECT count(*) AS `total`, ANY_VALUE(`created`) AS `created` FROM `mail` - WHERE `mail`.`uid` = %d GROUP BY `parent-uri` ORDER BY `created` DESC", - intval(local_user()) - ); - if (DBA::isResult($r)) { - $total = $r[0]['total']; - } + $total = DBA::count('mail', ['uid' => local_user()], ['distinct' => true, 'expression' => 'parent-uri']); $pager = new Pager(DI::l10n(), DI::args()->getQueryString());