Search block in header causes WARNING message when creating new page

Permalink
I got the Search block to work fine, but then when I added the Search block to the Default of different page types, so that the client wouldn't have to add it manually every time they create a new page of this type, I began to get this sort of warning message:

-----
"Warning: Cannot modify header information - headers already sent by (output started at /usr/home/blocks/search/controller.php:178) in /usr/home/concrete/startup/process.php on line 949"
-----

Line 949 of concrete/startup/process is:
header('Location: ' . URL_SITEMAP);

If blocks/search/controller.php:178 means "Line 178 of controller.php", that line is merely a closing PHP tag: ?>

If I ignore the warning message and hit the back button of my browser, it takes me back to the Sitemap and then if I go to visit the page, the page works fine. The search block even works fine on those pages.

I'm sure that will throw my client off when they add new pages, so I need to get rid of it. So, any idea what's the problem here?

 
zoinks replied on at Permalink Reply
Weirdly, this problem was solved by simply removing the closing PHP tag on line 178 of the Search block controller.php

...I don't know if there's any potential problems because of doing that, but I no longer get the warning message and the search boxes still work.

:shrug: