Ticket/10977

http://tracker.phpbb.com/browse/PHPBB3-10977

Replaces https://github.com/phpbb/phpbb3/pull/882