]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
Decrease scope of query in Profile::getEventsReminderHTML
[friendica.git] / mod / display.php
index 59e8aa277e5beb6a33dd020b88d4099f9b63e31f..eaf72c093ffb3b7a2a53962f8eaf0907d231c4f6 100644 (file)
@@ -5,7 +5,8 @@
 
 use Friendica\App;
 use Friendica\Content\Text\BBCode;
-use Friendica\Core\Acl;
+use Friendica\Content\Text\HTML;
+use Friendica\Core\ACL;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
@@ -211,7 +212,11 @@ function display_content(App $a, $update = false, $update_uid = 0) {
        if ($update) {
                $item_id = $_REQUEST['item_id'];
                $item = dba::selectFirst('item', ['uid', 'parent'], ['id' => $item_id]);
-               $a->profile = ['uid' => intval($item['uid']), 'profile_uid' => intval($item['uid'])];
+               if ($item['uid'] != 0) {
+                       $a->profile = ['uid' => intval($item['uid']), 'profile_uid' => intval($item['uid'])];
+               } else {
+                       $a->profile = ['uid' => intval($update_uid), 'profile_uid' => intval($update_uid)];
+               }
                $item_parent = $item['parent'];
        } else {
                $item_id = (($a->argc > 2) ? $a->argv[2] : 0);
@@ -317,7 +322,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
                        'default_location' => $a->user['default-location'],
                        'nickname' => $a->user['nickname'],
                        'lockstate' => (is_array($a->user) && (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'),
-                       'acl' => Acl::getFullSelectorHTML($a->user, true),
+                       'acl' => ACL::getFullSelectorHTML($a->user, true),
                        'bang' => '',
                        'visitor' => 'block',
                        'profile_uid' => local_user(),
@@ -367,10 +372,8 @@ function display_content(App $a, $update = false, $update_uid = 0) {
        $o .= conversation($a, $items, 'display', $update_uid);
 
        // Preparing the meta header
-       require_once 'include/html2plain.php';
-
-       $description = trim(html2plain(BBCode::convert($s[0]["body"], false), 0, true));
-       $title = trim(html2plain(BBCode::convert($s[0]["title"], false), 0, true));
+       $description = trim(HTML::toPlaintext(BBCode::convert($s[0]["body"], false), 0, true));
+       $title = trim(HTML::toPlaintext(BBCode::convert($s[0]["title"], false), 0, true));
        $author_name = $s[0]["author-name"];
 
        $image = $a->remove_baseurl($s[0]["author-thumb"]);