fix - trim the output of the fully rendered php to ensure that DOCTYPE is on the first line (fixes #2359)
Merge pull request #2478 from thomasedwards/4.0

fix - trim the output of the fully rendered php to ensure that DOCTYPE is on the first line (fixes #2479)