X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fredir.php;h=ba1b7e13b6a9f45cfe957c57816e31f553942f56;hb=6f70d21e07f5ae3ad96efe7c399db17ad390b73a;hp=557bbe4443173452cc8b292ca9530054a51c9f09;hpb=e34795762d72347746bd506f253495da7d0ab329;p=friendica.git diff --git a/mod/redir.php b/mod/redir.php index 557bbe4443..ba1b7e13b6 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -1,6 +1,6 @@ argc > 1 && intval($a->argv[1])) { - $cid = intval($a->argv[1]); + if (DI::args()->getArgc() > 1 && intval(DI::args()->getArgv()[1])) { + $cid = intval(DI::args()->getArgv()[1]); } else { $cid = 0; } @@ -77,7 +78,7 @@ function redir_init(App $a) { // Local user is already authenticated. redir_check_url($contact_url, $url); $target_url = $url ?: $contact_url; - Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG); + Logger::info($contact['name'] . " is already authenticated. Redirecting to " . $target_url); $a->redirect($target_url); } } @@ -94,7 +95,7 @@ function redir_init(App $a) { // Remote user is already authenticated. redir_check_url($contact_url, $url); $target_url = $url ?: $contact_url; - Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG); + Logger::info($contact['name'] . " is already authenticated. Redirecting to " . $target_url); $a->redirect($target_url); } } @@ -113,7 +114,7 @@ function redir_init(App $a) { $url .= $separator . 'zrl=' . urlencode($my_profile); } - Logger::log('redirecting to ' . $url, Logger::DEBUG); + Logger::info('redirecting to ' . $url); $a->redirect($url); } @@ -143,7 +144,7 @@ function redir_magic($a, $cid, $url) } // Test for magic auth on the target system - $serverret = DI::httpRequest()->get($basepath . '/magic'); + $serverret = DI::httpClient()->head($basepath . '/magic', [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::HTML]); if ($serverret->isSuccess()) { $separator = strpos($target_url, '?') ? '&' : '?'; $target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);