Ticket/10977

Replaces https://github.com/phpbb/phpbb3/pull/882