From b94697678e00578940abe0d89e1acfdd6317e3f8 Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 25 Dec 2024 20:43:15 +0000 Subject: [PATCH] refactor chdir() call --- bin/auth_ejabberd.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/bin/auth_ejabberd.php b/bin/auth_ejabberd.php index 247635b33d..2bffc9ce0a 100755 --- a/bin/auth_ejabberd.php +++ b/bin/auth_ejabberd.php @@ -50,19 +50,7 @@ use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Security\ExAuth; use Psr\Log\LoggerInterface; -if (sizeof($_SERVER["argv"]) == 0) { - die(); -} - -$directory = dirname($_SERVER["argv"][0]); - -if (substr($directory, 0, 1) != DIRECTORY_SEPARATOR) { - $directory = $_SERVER["PWD"] . DIRECTORY_SEPARATOR . $directory; -} - -$directory = realpath($directory . DIRECTORY_SEPARATOR . ".."); - -chdir($directory); +chdir(dirname(__FILE__, 2)); require dirname(__DIR__) . '/vendor/autoload.php';