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 fd1b40cc84..22087ed017 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 edfb8cd285..8305176157 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 965c495ecd..78eb74001d 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 05826f2e42..dbfd05a130 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 a39d049632..ad70bb176a 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 08e463bd40..95a319a41a 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; /**