[ticket/11568] Only assert string when doctype is there at all

PHPBB3-11568
[ticket/11568] Remove unused method

PHPBB3-11568