]> git.mxchange.org Git - friendica.git/commitdiff
Issue 11919: Avoid possible memory problems
authorMichael <heluecht@pirati.ca>
Sun, 25 Sep 2022 06:34:13 +0000 (06:34 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 25 Sep 2022 06:34:13 +0000 (06:34 +0000)
src/Module/Conversation/Community.php

index 8134c070e388f704e323769a317bf72fb3372bc1..646b2690772becd5012f6a54abb447781b4e3c41 100644 (file)
@@ -53,11 +53,19 @@ class Community extends BaseModule
        {
                $this->parseRequest();
 
+               $t = Renderer::getMarkupTemplate("community.tpl");
+               $o = Renderer::replaceMacros($t, [
+                       '$content' => '',
+                       '$header' => '',
+                       '$show_global_community_hint' => (self::$content == 'global') && DI::config()->get('system', 'show_global_community_hint'),
+                       '$global_community_hint' => DI::l10n()->t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.")
+               ]);
+
                if (DI::pConfig()->get(local_user(), 'system', 'infinite_scroll')) {
                        $tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
-                       $o = Renderer::replaceMacros($tpl, ['$reload_uri' => DI::args()->getQueryString()]);
+                       $o .= Renderer::replaceMacros($tpl, ['$reload_uri' => DI::args()->getQueryString()]);
                } else {
-                       $o = '';
+                       $o .= '';
                }
 
                if (empty($_GET['mode']) || ($_GET['mode'] != 'raw')) {
@@ -154,13 +162,7 @@ class Community extends BaseModule
                        $o .= $pager->renderMinimal(count($items));
                }
 
-               $t = Renderer::getMarkupTemplate("community.tpl");
-               return Renderer::replaceMacros($t, [
-                       '$content' => $o,
-                       '$header' => '',
-                       '$show_global_community_hint' => (self::$content == 'global') && DI::config()->get('system', 'show_global_community_hint'),
-                       '$global_community_hint' => DI::l10n()->t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.")
-               ]);
+               return $o;
        }
 
        /**