]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
rename CSS attributes notify => notification
[friendica.git] / mod / item.php
index b14da4604e7513d26a75fb9ca915360bea332e37..a9c5d43580794d660e7fa2a83099c994bd36c6a4 100644 (file)
@@ -19,9 +19,7 @@ use Friendica\App;
 use Friendica\Content\Pager;
 use Friendica\Content\Text\BBCode;
 use Friendica\Content\Text\HTML;
-use Friendica\Core\Config;
 use Friendica\Core\Hook;
-use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
 use Friendica\Core\Session;
@@ -123,7 +121,7 @@ function item_post(App $a) {
                }
 
                if (!DBA::isResult($toplevel_item)) {
-                       notice(L10n::t('Unable to locate original post.') . EOL);
+                       notice(DI::l10n()->t('Unable to locate original post.') . EOL);
                        if (!empty($_REQUEST['return'])) {
                                DI::baseUrl()->redirect($return_path);
                        }
@@ -170,7 +168,7 @@ function item_post(App $a) {
 
        // Now check that valid personal details have been provided
        if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
 
                if (!empty($_REQUEST['return'])) {
                        DI::baseUrl()->redirect($return_path);
@@ -246,7 +244,7 @@ function item_post(App $a) {
                $app               = $orig_post['app'];
                $categories        = $orig_post['file'];
                $title             = Strings::escapeTags(trim($_REQUEST['title']));
-               $body              = Strings::escapeHtml(trim($body));
+               $body              = trim($body);
                $private           = $orig_post['private'];
                $pubmail_enabled   = $orig_post['pubmail'];
                $network           = $orig_post['network'];
@@ -285,7 +283,7 @@ function item_post(App $a) {
                $coord             = Strings::escapeTags(trim($_REQUEST['coord']    ?? ''));
                $verb              = Strings::escapeTags(trim($_REQUEST['verb']     ?? ''));
                $emailcc           = Strings::escapeTags(trim($_REQUEST['emailcc']  ?? ''));
-               $body              = Strings::escapeHtml(trim($body));
+               $body              = trim($body);
                $network           = Strings::escapeTags(trim(($_REQUEST['network']  ?? '') ?: Protocol::DFRN));
                $guid              = System::createUUID();
 
@@ -316,7 +314,7 @@ function item_post(App $a) {
 
                // if using the API, we won't see pubmail_enable - figure out if it should be set
                if ($api_source && $profile_uid && $profile_uid == local_user() && !$private) {
-                       if (function_exists('imap_open') && !Config::get('system', 'imap_disabled')) {
+                       if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
                                $pubmail_enabled = DBA::exists('mailacct', ["`uid` = ? AND `server` != ? AND `pubmail`", local_user(), '']);
                        }
                }
@@ -325,7 +323,7 @@ function item_post(App $a) {
                        if ($preview) {
                                exit();
                        }
-                       info(L10n::t('Empty post discarded.') . EOL);
+                       info(DI::l10n()->t('Empty post discarded.') . EOL);
                        if (!empty($_REQUEST['return'])) {
                                DI::baseUrl()->redirect($return_path);
                        }
@@ -509,7 +507,7 @@ function item_post(App $a) {
        // Fold multi-line [code] sequences
        $body = preg_replace('/\[\/code\]\s*\[code\]/ism', "\n", $body);
 
-       $body = BBCode::scaleExternalImages($body, false);
+       $body = BBCode::scaleExternalImages($body);
 
        // Setting the object type if not defined before
        if (!$objecttype) {
@@ -797,14 +795,14 @@ function item_post(App $a) {
                                if (!strlen($addr)) {
                                        continue;
                                }
-                               $disclaimer = '<hr />' . L10n::t('This message was sent to you by %s, a member of the Friendica social network.', $a->user['username'])
+                               $disclaimer = '<hr />' . DI::l10n()->t('This message was sent to you by %s, a member of the Friendica social network.', $a->user['username'])
                                        . '<br />';
-                               $disclaimer .= L10n::t('You may visit them online at %s', DI::baseUrl() . '/profile/' . $a->user['nickname']) . EOL;
-                               $disclaimer .= L10n::t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL;
+                               $disclaimer .= DI::l10n()->t('You may visit them online at %s', DI::baseUrl() . '/profile/' . $a->user['nickname']) . EOL;
+                               $disclaimer .= DI::l10n()->t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL;
                                if (!$datarray['title']=='') {
                                        $subject = Email::encodeHeader($datarray['title'], 'UTF-8');
                                } else {
-                                       $subject = Email::encodeHeader('[Friendica]' . ' ' . L10n::t('%s posted an update.', $a->user['username']), 'UTF-8');
+                                       $subject = Email::encodeHeader('[Friendica]' . ' ' . DI::l10n()->t('%s posted an update.', $a->user['username']), 'UTF-8');
                                }
                                $link = '<a href="' . DI::baseUrl() . '/profile/' . $a->user['nickname'] . '"><img src="' . $author['thumb'] . '" alt="' . $a->user['username'] . '" /></a><br /><br />';
                                $html    = Item::prepareBody($datarray);
@@ -848,7 +846,7 @@ function item_post(App $a) {
 function item_post_return($baseurl, $api_source, $return_path)
 {
        // figure out how to return, depending on from whence we came
-    $a = \get_app();
+    $a = DI::app();
 
        if ($api_source) {
                return;
@@ -1061,7 +1059,7 @@ function handle_tag(&$body, &$inform, &$str_tags, $profile_uid, $tag, $network =
 
 function item_add_implicit_mentions(array $tags, array $thread_parent_contact, $thread_parent_id)
 {
-       if (Config::get('system', 'disable_implicit_mentions')) {
+       if (DI::config()->get('system', 'disable_implicit_mentions')) {
                // Add a tag if the parent contact is from ActivityPub or OStatus (This will notify them)
                if (in_array($thread_parent_contact['network'], [Protocol::OSTATUS, Protocol::ACTIVITYPUB])) {
                        $contact = Term::TAG_CHARACTER[Term::MENTION] . '[url=' . $thread_parent_contact['url'] . ']' . $thread_parent_contact['nick'] . '[/url]';