[ticket/12202] Fix tests

PHPBB3-12202
[ticket/12202] Can't call htmlspecialchars before checking for quotes

PHPBB3-12202