[ticket/10073] Deduplicate the if statement

PHPBB3-10073