mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-18 11:58:24 +01:00
fix double encoding of tree items
This commit is contained in:
parent
f1317e6b63
commit
76d6f179c6
@ -169,31 +169,11 @@ class Tree extends Etemplate\Widget
|
||||
Api\Json\Request::isJSONRequest(false);
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode(self::htmlencode_node($data));
|
||||
echo json_encode($data);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTML encoding of text and tooltip of node including all children
|
||||
*
|
||||
* @param array $item
|
||||
* @return array
|
||||
*/
|
||||
public static function htmlencode_node(array $item)
|
||||
{
|
||||
$item['text'] = Api\Html::htmlspecialchars($item['text']);
|
||||
|
||||
if (isset($item['item']) && is_array($item['item']))
|
||||
{
|
||||
foreach($item['item'] as &$child)
|
||||
{
|
||||
$child = self::htmlencode_node($child);
|
||||
}
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if given $id is one of given tree
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user