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

PHPBB3-11568
[ticket/11568] Remove unused method

PHPBB3-11568
Merge branch 'ticket/11568' into ticket/11568-develop

* ticket/11568:
  [ticket/11568] Remove unused method
  [ticket/11568] Only assert string when doctype is there at all