@@ -1979,20 +1979,23 @@ function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1979
1979
// Get data from child nodes if exist.
1980
1980
if ($ menu_item_srl &&$ tree [$ menu_item_srl ]) $ child_output = $ this ->getPhpCacheCode ($ tree [$ menu_item_srl ], $ tree , $ site_srl , $ domain );
1981
1981
else $ child_output = array ("buff " =>"" , "url_list " =>array ());
1982
+
1982
1983
// List variables
1983
1984
$ names = $ oMenuAdminModel ->getMenuItemNames ($ node ->name , $ site_srl );
1984
1985
unset($ name_arr_str );
1985
1986
foreach ($ names as $ key => $ val )
1986
1987
{
1987
- $ name_arr_str .= sprintf ('"%s"=>"%s" , ' ,$ key , str_replace (array ('\\' ,'" ' ), array ('\\\\' ,'" ' ), $ val ));
1988
+ $ name_arr_str .= sprintf ('"%s"=> \' %s \' , ' , $ key , str_replace (array ('\\' ,'\'' ), array ('\\\\' ,'\\\'' ), strip_tags ( $ val) ));
1988
1989
}
1989
1990
$ name_str = sprintf ('$_menu_names[%d] = array(%s); %s ' , $ node ->menu_item_srl , $ name_arr_str , $ child_output ['name ' ]);
1991
+
1990
1992
// If url value is not empty in the current node, put the value into an array url_list
1991
1993
if ($ node ->url ) $ child_output ['url_list ' ][] = $ node ->url ;
1992
1994
$ output ['url_list ' ] = array_merge ($ output ['url_list ' ], $ child_output ['url_list ' ]);
1993
1995
// If node->group_srls value exists
1994
1996
if ($ node ->group_srls )$ group_check_code = sprintf ('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s)) ' ,$ node ->group_srls ,$ node ->group_srls == -1 ?1 :0 );
1995
1997
else $ group_check_code = "true " ;
1998
+
1996
1999
// List variables
1997
2000
$ href = str_replace (array ('& ' ,'" ' ,'< ' ,'> ' ),array ('& ' ,'" ' ,'< ' ,'> ' ),$ node ->href );
1998
2001
$ url = str_replace (array ('& ' ,'" ' ,'< ' ,'> ' ),array ('& ' ,'" ' ,'< ' ,'> ' ),$ node ->url );
@@ -2046,10 +2049,10 @@ function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
2046
2049
}
2047
2050
// Create properties (check if it belongs to the menu node by url_list. It looks a trick but fast and powerful)
2048
2051
$ attribute = sprintf (
2049
- '"node_srl"=>"%s", "parent_srl"=>"%s", "menu_name_key"=> \'%s \',"isShow"=> (%s? true: false),"text"=> (%s? $_menu_names[%d][$lang_type]: ""),"href"=> (%s?%s: ""),"url"=> (%s? "%s": ""),"is_shortcut"=> "%s","desc"=> \'%s \',"open_window"=> "%s","normal_btn"=> "%s","hover_btn"=> "%s","active_btn"=> "%s","selected"=> (array(%s)&& in_array(Context::get("mid"),array(%s))?1: 0),"expand"=>"%s" , "list"=> array(%s), "link"=> (%s? ( array(%s)&& in_array(Context::get("mid"),array(%s)) ?%s: %s): ""), ' ,
2052
+ '"node_srl" => %d, "parent_srl" => %d, "menu_name_key" => \'%s \', "isShow" => (%s ? true : false), "text" => (%s ? $_menu_names[%d][$lang_type] : ""), "href" => (%s ? %s : ""), "url" => (%s ? "%s" : ""), "is_shortcut" => "%s", "desc" => \'%s \', "open_window" => "%s", "normal_btn" => "%s", "hover_btn" => "%s", "active_btn" => "%s", "selected" => (array(%s) && in_array(Context::get("mid"), array(%s)) ? 1 : 0), "expand" => \' %s \' , "list" => array(%s), "link" => (%s ? (array(%s) && in_array(Context::get("mid"), array(%s)) ? %s : %s) : ""), ' ,
2050
2053
$ node ->menu_item_srl ,
2051
2054
$ node ->parent_srl ,
2052
- addslashes ($ node ->name ),
2055
+ strip_tags ( addslashes ($ node ->name ) ),
2053
2056
$ group_check_code ,
2054
2057
$ group_check_code ,
2055
2058
$ node ->menu_item_srl ,
0 commit comments