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:
@@ -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.';';
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user