please use https://github.com/phpbb/phpbb3/blob/develop/phpBB/phpbb/controller/helper.php#L96 ?