[ticket/11915] Pass the data to the template instead of scraping HTML for it.

PHPBB3-11915