Warning: Headers Already Sent
-
Thank you so much for this plug-in, extremely helpful!
Quick suggestion. When I first ran the export, I was getting a page of users, along with an error/warning that Headers had already been sent.
I simply moved
$this->send_file_stream_http_headers();
To the first thing in the try function, so the headers were the first thing to write to the page (as opposed to the CSV).
So, the try at line 209 is now
try { $this->send_file_stream_http_headers(); $csv = ( new CSV() ) ->set_filename( 'php://output' ) ->set_columns( $columns ) ->set_delimiter( $delimiter_char ) ->set_enclosure( $enclosure_char ) ->set_allowlist( $allowlist ) ->set_denylist( $denylist );
And it works like a dream. Not sure if that would have far reaching effects or not — but so far, have not seen any issues.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Warning: Headers Already Sent’ is closed to new replies.