1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

NewForumPosts could fail under some circumstances. Extra checks added for e107::unserialize();

This commit is contained in:
Cameron
2016-03-25 11:24:07 -07:00
parent 7880dc5817
commit efc2e62953
3 changed files with 17 additions and 3 deletions

View File

@@ -450,6 +450,14 @@ class e_array {
$ArrayData = str_replace('=>','=>',$ArrayData); //FIX for PDO encoding of strings. .
if(trim($ArrayData) == 'Array') // Something went wrong with storage.
{
$debug = debug_backtrace(false);
e107::getMessage()->addDebug("Bad Array Storage found: ". print_a($debug,true));
return array();
}
$data = "";
$ArrayData = '$data = '.$ArrayData.';';

View File

@@ -946,8 +946,14 @@ class e_media
{
$icons[] = $prefix.substr($match[1],3);
}
if(empty($icons)) // failed to produce a result so don't cache it. .
{
return array();
}
$data = e107::serialize($icons);
$cache->set($type,$data,true);
return $icons;

View File

@@ -139,9 +139,9 @@ class forum_newforumposts_menu // plugin folder + menu name (without the .php)
}
if(isset($this->menuPref['caption']))
if(!empty($this->menuPref['caption']))
{
$caption = varset($this->menuPref['caption'][e_LANGUAGE], $this->menuPref['caption']);
$caption = !empty($this->menuPref['caption'][e_LANGUAGE]) ? $this->menuPref['caption'][e_LANGUAGE] : $this->menuPref['caption'];
}
else
{