mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-03 14:20:43 +01:00
Only check for nonce if the getNonce method exists (nonces are implemented in Grav)
This commit is contained in:
@@ -87,9 +87,11 @@ class AdminController
|
||||
public function execute()
|
||||
{
|
||||
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;
|
||||
if (method_exists('Utils', 'getNonce')) {
|
||||
if (!isset($this->post['admin-nonce']) || !Utils::verifyNonce($this->post['admin-nonce'], 'admin-form')) {
|
||||
$this->admin->setMessage('Unauthorized', 'error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user