[ticket/11563] Remove duplicate code

PHPBB3-11563