make CLI check compatible to PHP internal server

This commit is contained in:
Daniel Seifert 2021-11-29 10:07:56 +01:00
parent 66ff1aa732
commit d835b64fe3
Signed by: DanielS
GPG Key ID: 8A7C4C6ED1915C6F
1 changed files with 1 additions and 1 deletions

View File

@ -304,7 +304,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
if (ob_get_contents()) {
$oPdf->pdf->Error('Some data has already been output, can\'t send PDF file');
}
if (php_sapi_name() != 'cli') {
if (substr(php_sapi_name(), 0, 3) != 'cli') {
//We send to a browser
header('Content-Type: text/html');
if (headers_sent()) {