Painbaker
Well-known member
- Affected version
 - 2.3.3, 2.2.16
 
If the user has broken or modified  
 
	
	
	
		
As there is no
	
	
	
		
				
			xf_multiQuoteThread local storage data an error like this might occur:
		Code:
	
	ErrorException: [E_WARNING] foreach() argument must be of type array|object, string given in src\XF\ControllerPlugin\QuotePlugin.php at line 75
    XF::handlePhpError() in src\XF\ControllerPlugin\QuotePlugin.php at line 75
    XF\ControllerPlugin\QuotePlugin->XF\ControllerPlugin\{closure}()
    array_map() in src\XF\ControllerPlugin\QuotePlugin.php at line 73
    XF\ControllerPlugin\QuotePlugin->prepareQuotes() in src\XF\Pub\Controller\ThreadController.php at line 856
    XF\Pub\Controller\ThreadController->actionMultiQuote() in src\XF\Mvc\Dispatcher.php at line 362
    XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 264
    XF\Mvc\Dispatcher->dispatchFromMatch() in src\XF\Mvc\Dispatcher.php at line 121
    XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 63
    XF\Mvc\Dispatcher->run() in src\XF\App.php at line 2826
    XF\App->run() in src\XF.php at line 806
    XF::runApp() in index.php at line 23
	As there is no
is_array  validation here:
		PHP:
	
	    public function prepareQuotes(array $quotes)
    {
        return array_map(function($quotes)
        {
            foreach ($quotes AS $i => &$quote)
            {
                if ($quote === null)
                {
                    unset($quotes[$i]);
                }
                else if ($quote !== true)
                {
                    $quote = $this->prepareMessage(null, $quote);
                }
            }
            return $quotes;
        }, $quotes);
    }
	
			
				Last edited: