Fixes #7488 - correctly display hostgroups with / in their names

Original bug was about hostgroup names containing html closing tags.
This was actually a bug affecting all objects with ancestry (hostgroups, locations, organizations) containing the `/` character in their names.