Warning: Cannot modify header information - headers already sent by #181
Labels
feedback-wanted
Looking for feedback on the issue at hand. Opinions please, constructive ones preferred.
Milestone
@johanneskonst - Looking at cleaning up php messages.
With config-debug turned on the following warning message is issued
'Warning: Cannot modify header information - headers already sent by...'
This is caused by the following code in ...\core\httpclient.php lines 168, 169.
if ($config['debug']) echoHeaders($response['header'])."<p>";
if ($config['debug']) echo "data:<br>".htmlspecialchars($response['data'])."<p>";
This occurs when a movie is displayed and videodb is querying imdb for the actors images via img,php.
Another consequence of the code is that when imdb online is selected it dumps the header and page data as source into the browser, but the imdb page is not rendered as JavaScript fails.
Questions
1 - is this code needed.
2 - could it be moved into 'httpclientlog' at line 172. (header is already being done here. ). would suggest tags added to file to find the start and end of each response.
Suggested code
if ($config['httpclientlog'])
{$log = fopen('httpClient.log', 'a');
fwrite($log,"\n+++ Start header\n");
fwrite($log, headers_to_string($response['header']));
fwrite($log,"\n+++ End header");
fwrite($log,"\n+++ Start Data\n");
fwrite($log, htmlspecialchars($response['data'])."\n");
fwrite($log,"\n+++ End data");
fclose($log);
}
3 - comment out for now and re-look at when issue 177 is done
4 - any other suggestions
The text was updated successfully, but these errors were encountered: