diff --git a/app/controllers/blubber.php b/app/controllers/blubber.php index 35a8d7e573d2dd3d8467d6642b47bb009649cb80..9ec12b99aba2dc98a45b37fd501c908539f9c291 100644 --- a/app/controllers/blubber.php +++ b/app/controllers/blubber.php @@ -45,16 +45,16 @@ class BlubberController extends AuthenticatedController $this->thread = array_pop($threads); } + $this->thread_data = []; if ($this->thread) { $this->thread->markAsRead(); + $this->thread_data = $this->thread->getJSONData( + 50, + null, + Request::get("search") + ); } - $this->thread_data = $this->thread->getJSONData( - 50, - null, - Request::get("search") - ); - if (!Avatar::getAvatar($GLOBALS['user']->id)->is_customized() && !$_SESSION['already_asked_for_avatar']) { $_SESSION['already_asked_for_avatar'] = true; PageLayout::postInfo(sprintf( diff --git a/app/views/blubber/index.php b/app/views/blubber/index.php index 0daceb688f614c384638b77279a7942f7f24d48a..f1704d45de5c17aae52e06b124955fe41eb9ae8f 100644 --- a/app/views/blubber/index.php +++ b/app/views/blubber/index.php @@ -1,5 +1,5 @@ <div class="blubber_panel" - data-active_thread="<?= htmlReady($thread->getId()) ?>" + data-active_thread="<?= htmlReady(!empty($thread) ? $thread->getId() : '') ?>" data-thread_data="<?= htmlReady(json_encode($thread_data ?: ['thread_posting' => []])) ?>" data-threads_more_down="<?= htmlReady($threads_more_down) ?>" :class="waiting ? 'waiting' : ''">