CollaboraOnline / richdocumentscode

Built-in CODE Server app
https://apps.nextcloud.com/apps/richdocumentscode
Apache License 2.0
121 stars 29 forks source link

Move calls to http_response_code() before doing print() #293

Open giox069 opened 3 weeks ago

giox069 commented 3 weeks ago

Calling http_response_code() after print() has no effect and it logs a warning "headers already sent" on the web server logs. When PHP has display_errors enabled, the warning is also sent as a response to the browser, and the browser is unable to open CODE application. This commit fixes #286 and #270 by moving one http_response_code(400) call before "print", and by removing two useless http_response_code(200);, which is the default value.