QuotePlugin::getQuote calls getBbCodeForQuote twice

Xon

Well-known member
Affected version
2.3.7
PHP:
		$innerContent = $this->app->stringFormatter()->getBbCodeForQuote($message, $context);
		if (strlen($innerContent))
		{
			$quote = $content->getQuoteWrapper(
				$this->app->stringFormatter()->getBbCodeForQuote($message, $context)
			);
		}

I'm not sure there is much point to calling getBbCodeForQuote twice instead of just using that $innerContent variable.

Also actionMultiQuote() should have some updates;


PHP:
			if (!$message)
			{
				continue;
			}
			[$quote, $quoteHtml] = $this->getQuote($content, $message, $context);

			$output[] = ['quote' => $quote, 'quoteHtml' => $quoteHtml];

If a post is 0, then $message will be falsy, and getQuote() and return empty quote/quoteHtml which appears to be intended to be avoided given early empty checks.
 
Back
Top Bottom