See https://github.com/phpbb/phpbb/pull/2508/files#diff-519d07646d02372fec07aebf0c4457b1R16 for how to do this more properly.