mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +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. .
|
$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 = "";
|
$data = "";
|
||||||
$ArrayData = '$data = '.$ArrayData.';';
|
$ArrayData = '$data = '.$ArrayData.';';
|
||||||
|
|
||||||
|
@@ -947,7 +947,13 @@ class e_media
|
|||||||
$icons[] = $prefix.substr($match[1],3);
|
$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);
|
$data = e107::serialize($icons);
|
||||||
|
|
||||||
$cache->set($type,$data,true);
|
$cache->set($type,$data,true);
|
||||||
return $icons;
|
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
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user