Replace 'REQUEST_METHOD' with App\Arguments::getMethod()

This commit is contained in:
Philipp
2022-01-03 19:30:27 +01:00
parent a3a32af5c1
commit 543e4be0a6
4 changed files with 6 additions and 8 deletions

View File

@@ -53,7 +53,7 @@ function pubsub_init(App $a)
$nick = ((DI::args()->getArgc() > 1) ? trim(DI::args()->getArgv()[1]) : '');
$contact_id = ((DI::args()->getArgc() > 2) ? intval(DI::args()->getArgv()[2]) : 0 );
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (DI::args()->getMethod() === App\Router::GET) {
$hub_mode = trim($_GET['hub_mode'] ?? '');
$hub_topic = trim($_GET['hub_topic'] ?? '');
$hub_challenge = trim($_GET['hub_challenge'] ?? '');

View File

@@ -43,7 +43,7 @@ function pubsubhubbub_init(App $a) {
// [hub_secret] => af11...
// [hub_topic] => http://friendica.local/dfrn_poll/sazius
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (DI::args()->getMethod() === App\Router::POST) {
$hub_mode = $_POST['hub_mode'] ?? '';
$hub_callback = $_POST['hub_callback'] ?? '';
$hub_verify_token = $_POST['hub_verify_token'] ?? '';