[ticket/12268] Do not use substr but just compare the character

PHPBB3-12268