From e768778691b1c824269bbd059d77a7b489a2850c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=CC=81n=20Mikla=CC=81s=CC=8C?= Date: Wed, 25 Sep 2019 13:20:03 +0200 Subject: [PATCH] Allow API to accept GET requests [MAILPOET-2378] --- lib/API/JSON/API.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/API/JSON/API.php b/lib/API/JSON/API.php index b0aea0cc87..82619f3b2a 100644 --- a/lib/API/JSON/API.php +++ b/lib/API/JSON/API.php @@ -79,7 +79,11 @@ class API { function setupAjax() { $this->wp->doAction('mailpoet_api_setup', [$this]); - $this->setRequestData($_POST); + if (isset($_POST['api_version'])) { + $this->setRequestData($_POST); + } else { + $this->setRequestData($_GET); + } $ignoreToken = ( $this->settings->get('captcha.type') != Captcha::TYPE_DISABLED &&