[ticket/13280] Properly format the current page and add sanitizer to tests

Ticket: https://tracker.phpbb.com/browse/PHPBB3-13280
I'm pretty sure you can't call another anonymous function inside an anonymous function?