diff --git a/file/lib/data/chat/room/ChatRoom.class.php b/file/lib/data/chat/room/ChatRoom.class.php index dc1bc5b..f15e5e1 100644 --- a/file/lib/data/chat/room/ChatRoom.class.php +++ b/file/lib/data/chat/room/ChatRoom.class.php @@ -1,5 +1,6 @@ addResource( - 'chatrooms', - WCF_DIR.'cache/cache.chatrooms.php', - 'wcf\system\cache\builder\ChatRoomCacheBuilder' - ); - self::$cache = CacheHandler::getInstance()->get('chatrooms'); + public static function getCache() { + if (self::$cache === null) { + CacheHandler::getInstance()->addResource( + 'chatrooms', + WCF_DIR.'cache/cache.chatrooms.php', + 'wcf\system\cache\builder\ChatRoomCacheBuilder' + ); + self::$cache = CacheHandler::getInstance()->get('chatrooms'); + } + + return self::$cache; } /** diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index e0996f2..19abe1f 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -1,6 +1,7 @@ rooms = chat\room\ChatRoom::getCache(); + if (isset($this->rooms[$this->roomID])) { + $this->room = $this->rooms[$this->roomID]; + } + else { + throw new \wcf\system\exception\IllegalLinkException(); + } } /**