From fbdd6b96da8d44ae37bfb451690998a78d224f8c Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 13 Oct 2016 20:45:44 +0200 Subject: [PATCH] fixed some oversights --- app/BBCode/Parser.php | 5 +++++ app/BBCode/Tags/NamedQuote.php | 1 - app/Forum/Post.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/BBCode/Parser.php b/app/BBCode/Parser.php index dd1ca9a..cf309af 100644 --- a/app/BBCode/Parser.php +++ b/app/BBCode/Parser.php @@ -68,6 +68,11 @@ class Parser // Parse all emoticons foreach ($emotes as $emote) { + if ($poster === null) { + // eventually check for hierarchies here + continue; + } + $image = "{$emote->emote_string}"; $icon = preg_quote($emote->emote_string, '#'); $text = preg_replace("#{$icon}#", $image, $text); diff --git a/app/BBCode/Tags/NamedQuote.php b/app/BBCode/Tags/NamedQuote.php index 51bed29..343ba2d 100644 --- a/app/BBCode/Tags/NamedQuote.php +++ b/app/BBCode/Tags/NamedQuote.php @@ -7,7 +7,6 @@ namespace Sakura\BBCode\Tags; use Sakura\BBCode\TagBase; -use Sakura\CurrentSession; use Sakura\Forum\Forum; use Sakura\Forum\Post; use Sakura\Perms\Forum as ForumPerms; diff --git a/app/Forum/Post.php b/app/Forum/Post.php index dec9e5c..b75d7ea 100644 --- a/app/Forum/Post.php +++ b/app/Forum/Post.php @@ -171,7 +171,7 @@ class Post 'post_time' => time(), 'post_subject' => $subject, 'post_text' => $text, - 'post_text_parsed' => BBParser::toHTML(htmlentities($text), $this->poster), + 'post_text_parsed' => BBParser::toHTML(htmlentities($text), $poster), ]); // Update the last post date