mirror of
https://github.com/e107inc/e107.git
synced 2025-08-16 11:36:08 +02:00
Fixes #2037 Menu-Cache encoding changed to json for more reliable handling of array data. Error catching added on eval() code with syntax errors when PHP7 is being used.
This commit is contained in:
@@ -222,19 +222,19 @@ class e_menu
|
||||
$menu_layout_field = THEME_LAYOUT!=e107::getPref('sitetheme_deflayout') ? THEME_LAYOUT : "";
|
||||
|
||||
// e107::getCache()->CachePageMD5 = md5(e_LANGUAGE.$menu_layout_field); // Disabled by line 93 of Cache class.
|
||||
//FIXME add a function to the cache class for this.
|
||||
|
||||
$menu_data = e107::getCache()->retrieve_sys("menus_".USERCLASS_LIST."_".md5(e_LANGUAGE.$menu_layout_field));
|
||||
// $menu_data = e107::getCache()->retrieve_sys("menus_".USERCLASS_LIST);
|
||||
$menu_data = e107::getArrayStorage()->ReadArray($menu_data);
|
||||
// $menu_data = e107::getArrayStorage()->ReadArray($menu_data);
|
||||
|
||||
//FIXME add a function to the cache class for this.
|
||||
|
||||
$cacheData = e107::getCache()->retrieve_sys("menus_".USERCLASS_LIST."_".md5(e_LANGUAGE.$menu_layout_field));
|
||||
|
||||
// $menu_data = json_decode($cacheData,true);
|
||||
$menu_data = e107::unserialize($cacheData);
|
||||
|
||||
$eMenuArea = array();
|
||||
// $eMenuList = array();
|
||||
// $eMenuActive = array(); // DEPRECATED
|
||||
|
||||
|
||||
if(!is_array($menu_data))
|
||||
if(empty($menu_data) || !is_array($menu_data))
|
||||
{
|
||||
$menu_qry = 'SELECT * FROM #menus WHERE menu_location > 0 AND menu_class IN ('.USERCLASS_LIST.') AND menu_layout = "'.$menu_layout_field.'" ORDER BY menu_location,menu_order';
|
||||
|
||||
@@ -247,10 +247,9 @@ class e_menu
|
||||
}
|
||||
|
||||
$menu_data['menu_area'] = $eMenuArea;
|
||||
|
||||
$menuData = e107::getArrayStorage()->WriteArray($menu_data, false);
|
||||
|
||||
// e107::getCache()->set_sys('menus_'.USERCLASS_LIST, $menuData);
|
||||
|
||||
$menuData = e107::serialize($menu_data,'json');
|
||||
|
||||
e107::getCache()->set_sys('menus_'.USERCLASS_LIST.'_'.md5(e_LANGUAGE.$menu_layout_field), $menuData);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user