/**
 * Method to escape output.
 *
 * @param   string  $output  The output to escape.
 *
 * @return  string  The escaped output.
 *
 * @note the ENT_COMPAT flag was replaced by ENT_QUOTES in Joomla 4.0 to also escape single quotes
 *
 * @since   3.0
 */
public function escape($output)
{
    return $output === null ? '' : htmlspecialchars($output, ENT_QUOTES, 'UTF-8');
}