Check if headers were sent

This commit is contained in:
Daniil Gentili 2018-12-27 23:10:25 +01:00
parent aed36aac8d
commit 69505c3e8b

View File

@ -127,7 +127,7 @@ trait Loop
} }
public function closeConnection($message = 'OK!') public function closeConnection($message = 'OK!')
{ {
if (php_sapi_name() === 'cli' || isset($GLOBALS['exited'])) { if (php_sapi_name() === 'cli' || isset($GLOBALS['exited']) || headers_sent()) {
return; return;
} }
@ob_end_clean(); @ob_end_clean();