Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / forum / forum.module
index c2de3c9e0bde94974060ac64b698150595479cde..b6689567469a927638b16c70e98d6099be1e6cc0 100644 (file)
@@ -455,17 +455,20 @@ function template_preprocess_forums(&$variables) {
           $variables['topics'][$id]->title_link = \Drupal::l($topic->getTitle(), $topic->urlInfo());
           $variables['topics'][$id]->message = '';
         }
-        $forum_submitted = ['#theme' => 'forum_submitted', '#topic' => (object) [
-          'uid' => $topic->getOwnerId(),
-          'name' => $topic->getOwner()->getDisplayName(),
-          'created' => $topic->getCreatedTime(),
-        ]];
-        $variables['topics'][$id]->submitted = drupal_render($forum_submitted);
+        $forum_submitted = [
+          '#theme' => 'forum_submitted',
+          '#topic' => (object) [
+            'uid' => $topic->getOwnerId(),
+            'name' => $topic->getOwner()->getDisplayName(),
+            'created' => $topic->getCreatedTime(),
+          ],
+        ];
+        $variables['topics'][$id]->submitted = \Drupal::service('renderer')->render($forum_submitted);
         $forum_submitted = [
           '#theme' => 'forum_submitted',
           '#topic' => isset($topic->last_reply) ? $topic->last_reply : NULL,
         ];
-        $variables['topics'][$id]->last_reply = drupal_render($forum_submitted);
+        $variables['topics'][$id]->last_reply = \Drupal::service('renderer')->render($forum_submitted);
 
         $variables['topics'][$id]->new_text = '';
         $variables['topics'][$id]->new_url = '';
@@ -569,7 +572,7 @@ function template_preprocess_forum_list(&$variables) {
       $variables['forums'][$id]->old_topics = $forum->num_topics - $variables['forums'][$id]->new_topics;
     }
     $forum_submitted = ['#theme' => 'forum_submitted', '#topic' => $forum->last_post];
-    $variables['forums'][$id]->last_reply = drupal_render($forum_submitted);
+    $variables['forums'][$id]->last_reply = \Drupal::service('renderer')->render($forum_submitted);
   }
 
   $variables['pager'] = [
@@ -636,7 +639,7 @@ function template_preprocess_forum_submitted(&$variables) {
   $variables['author'] = '';
   if (isset($variables['topic']->uid)) {
     $username = ['#theme' => 'username', '#account' => User::load($variables['topic']->uid)];
-    $variables['author'] = drupal_render($username);
+    $variables['author'] = \Drupal::service('renderer')->render($username);
   }
   $variables['time'] = isset($variables['topic']->created) ? \Drupal::service('date.formatter')->formatTimeDiffSince($variables['topic']->created) : '';
 }