From ec5bd9a756ae2273dbe5915b0b1fd60f0320896a Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 30 Oct 2021 09:13:06 +0000 Subject: [PATCH] Reverting some parts because wouldn't work --- bin/auth_ejabberd.php | 3 ++- bin/console.php | 3 ++- bin/daemon.php | 3 ++- bin/testargs.php | 3 ++- bin/worker.php | 3 ++- src/Module/Friendica.php | 1 - 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/auth_ejabberd.php b/bin/auth_ejabberd.php index fd1b40cc8..22087ed01 100755 --- a/bin/auth_ejabberd.php +++ b/bin/auth_ejabberd.php @@ -54,7 +54,8 @@ use Friendica\Network\HTTPException\ForbiddenException; if (php_sapi_name() !== 'cli') { - throw new ForbiddenException(); + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); } use Dice\Dice; diff --git a/bin/console.php b/bin/console.php index edfb8cd28..830517615 100755 --- a/bin/console.php +++ b/bin/console.php @@ -23,7 +23,8 @@ use Friendica\Network\HTTPException\ForbiddenException; if (php_sapi_name() !== 'cli') { - throw new ForbiddenException(); + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); } use Dice\Dice; diff --git a/bin/daemon.php b/bin/daemon.php index 965c495ec..78eb74001 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -26,7 +26,8 @@ use Friendica\Network\HTTPException\ForbiddenException; if (php_sapi_name() !== 'cli') { - throw new ForbiddenException(); + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); } use Dice\Dice; diff --git a/bin/testargs.php b/bin/testargs.php index 05826f2e4..dbfd05a13 100644 --- a/bin/testargs.php +++ b/bin/testargs.php @@ -29,7 +29,8 @@ use Friendica\Network\HTTPException\ForbiddenException; if (php_sapi_name() !== 'cli') { - throw new ForbiddenException(); + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); } if (($_SERVER["argc"] > 1) && isset($_SERVER["argv"][1])) { diff --git a/bin/worker.php b/bin/worker.php index a39d04963..ad70bb176 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -24,7 +24,8 @@ use Friendica\Network\HTTPException\ForbiddenException; if (php_sapi_name() !== 'cli') { - throw new ForbiddenException(); + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); } use Dice\Dice; diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index 08e463bd4..95a319a41 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -30,7 +30,6 @@ use Friendica\Database\PostUpdate; use Friendica\DI; use Friendica\Model\User; use Friendica\Network\HTTPException; -use Friendica\Network\HTTPException\ImATeapotException; use Friendica\Protocol\ActivityPub; /**