MyBB Community Forums

Full Version: Unknown error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I updated my board to 1.2 some days ago and all was ok, but today i got that error when i read threads (only then):
Warning: Invalid argument supplied for foreach() in /home2/otfans/public_html/forums/inc/class_parser.php on line 344
I tried to fix this error and i looked in class_parser.php (line 344):
	function cache_smilies()
	{
		global $cache;
		$this->smilies_cache = array();

		$smilies = $cache->read("smilies");
		foreach($smilies as $sid => $smilie)  // <- here is line 344
		{
			$this->smilies_cache[$smilie['find']] = "<img src=\"{$this->base_url}{$smilie['image']}\" style=\"vertical-align: middle;\" border=\"0\" alt=\"{$smilie['name']}\" title=\"{$smilie['name']}\" />";
		}
	}
But i have no idea how to fix it.
Do you have any smilies? or you delete them?
Well potentional fix.
under:
$smilies = $cache->read("smilies");
add:
if(!is_array($smilies)) {
$smilies = array();
}