X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=4f3acdee5521545717d9b9907184dd8de8a1edb0;hb=e84ad1556926acfebadfb70fd3161a0bc9ef4c6d;hp=3e2cccb76e793a0cb760e2fc2588ced94ab4e714;hpb=91facd2d0a2869e2c26a5943d8afe1849d3891f8;p=friendica.git diff --git a/mod/message.php b/mod/message.php index 3e2cccb76e..4f3acdee55 100644 --- a/mod/message.php +++ b/mod/message.php @@ -13,15 +13,15 @@ use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Mail; -use Friendica\Module\Login; +use Friendica\Module\Security\Login; use Friendica\Util\DateTimeFormat; use Friendica\Util\Proxy as ProxyUtils; +use Friendica\Util\Strings; use Friendica\Util\Temporal; -require_once 'include/conversation.php'; - function message_init(App $a) { $tabs = ''; @@ -37,15 +37,15 @@ function message_init(App $a) 'accesskey' => 'm', ]; - $tpl = get_markup_template('message_side.tpl'); - $a->page['aside'] = Renderer::replaceMacros($tpl, [ + $tpl = Renderer::getMarkupTemplate('message_side.tpl'); + DI::page()['aside'] = Renderer::replaceMacros($tpl, [ '$tabs' => $tabs, '$new' => $new, ]); $base = System::baseUrl(); - $head_tpl = get_markup_template('message-head.tpl'); - $a->page['htmlhead'] .= Renderer::replaceMacros($head_tpl, [ + $head_tpl = Renderer::getMarkupTemplate('message-head.tpl'); + DI::page()['htmlhead'] .= Renderer::replaceMacros($head_tpl, [ '$baseurl' => System::baseUrl(true), '$base' => $base ]); @@ -58,10 +58,10 @@ function message_post(App $a) return; } - $replyto = x($_REQUEST, 'replyto') ? notags(trim($_REQUEST['replyto'])) : ''; - $subject = x($_REQUEST, 'subject') ? notags(trim($_REQUEST['subject'])) : ''; - $body = x($_REQUEST, 'body') ? escape_tags(trim($_REQUEST['body'])) : ''; - $recipient = x($_REQUEST, 'messageto') ? intval($_REQUEST['messageto']) : 0; + $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['messageto']) ? intval($_REQUEST['messageto']) : 0; $ret = Mail::send($recipient, $body, $subject, $replyto); $norecip = false; @@ -89,7 +89,7 @@ function message_post(App $a) $a->argc = 2; $a->argv[1] = 'new'; } else { - $a->internalRedirect($a->cmd . '/' . $ret); + DI::baseUrl()->redirect(DI::args()->getCommand() . '/' . $ret); } } @@ -105,7 +105,7 @@ function message_content(App $a) $myprofile = System::baseUrl() . '/profile/' . $a->user['nickname']; - $tpl = get_markup_template('mail_head.tpl'); + $tpl = Renderer::getMarkupTemplate('mail_head.tpl'); if ($a->argc > 1 && $a->argv[1] == 'new') { $button = [ 'label' => L10n::t('Discard'), @@ -134,7 +134,7 @@ function message_content(App $a) if (!empty($_REQUEST['confirm'])) { //