mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-05 15:20:59 +01:00
Only check nonce on POST requests
This commit is contained in:
@@ -86,9 +86,11 @@ class AdminController
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if (!isset($this->post['admin-nonce']) || !Utils::verifyNonce($this->post['admin-nonce'], 'admin-form')) {
|
||||
$this->admin->setMessage('Unauthorized', 'error');
|
||||
return false;
|
||||
if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
|
||||
if (!isset($this->post['admin-nonce']) || !Utils::verifyNonce($this->post['admin-nonce'], 'admin-form')) {
|
||||
$this->admin->setMessage('Unauthorized', 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$success = false;
|
||||
|
||||
Reference in New Issue
Block a user