I experienced having a module with newlines after the php end-tag. This caused all my pages to get a newline on top, before the DOCTYPE tag. When using AJAX modules like activemenu, the data fetched from the server was prepended with spaces and newlines, thus failing the '{' check.

I suggest stripping any prepending blanks and maybe newlines.

Comments

Steven’s picture

Status: Active » Closed (won't fix)

Having blanks inserted at the top will cause more problems than just with Ajax. Header statements would fail (resulting in the common 'headers already sent' error), XML feeds would be invalid, doctypes would not be interpreted and generated images would break.