Menü schliessen
Created: December 5th 2011
Last updated: May 1st 2020
Categories: Joomla
Author: Marcus Fleuti

Joomla shows HTML entity code in menu header instead of the special character

Tags:  HTML,  Joomla
Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

The problem

We want to have a menu with the name "Sun & Fun" in the top menu of the page. The problem is that Joomla by default converts the "&" special character into "&".

The reason

Due to security reasons Joomla converts all special characters into HTML entities (because if it would not do this a user who has permission to create new articles could enter various code into the menu which would run once a user clicks that menu).
But for regular websites where only a web administrator creates new articles this behaviour is not intended.

How can this behaviour be changed in Joomla?

This behaviour can be easily be solved by editing the file

/modules/mod_menu/helper.php

and change this (at around row #112):

$item->title = htmlspecialchars($item->title);

to this:

$item->title = $item->title;