mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-26 15:56:30 +01:00
Use Url:post() to get the $_POST variable (allows common security checks/filtering for the POST data)
This commit is contained in:
@@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
1. [](#new)
|
1. [](#new)
|
||||||
* Added new event `onAdminPage` which allows plugins to customize `Page` object in `$event['page']`
|
* Added new event `onAdminPage` which allows plugins to customize `Page` object in `$event['page']`
|
||||||
|
1. [](#improved)
|
||||||
|
* Use `Url:post()` to get the `$_POST` variable (allows common security checks/filtering for the POST data)
|
||||||
|
|
||||||
# v1.8.9
|
# v1.8.9
|
||||||
## 08/23/2018
|
## 08/23/2018
|
||||||
|
|
||||||
|
|||||||
@@ -360,7 +360,7 @@ class AdminPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make local copy of POST.
|
// Make local copy of POST.
|
||||||
$post = !empty($_POST) ? $_POST : [];
|
$post = $this->grav['uri']->post();
|
||||||
|
|
||||||
// Handle tasks.
|
// Handle tasks.
|
||||||
$this->admin->task = $task = !empty($post['task']) ? $post['task'] : $this->uri->param('task');
|
$this->admin->task = $task = !empty($post['task']) ? $post['task'] : $this->uri->param('task');
|
||||||
|
|||||||
@@ -595,7 +595,8 @@ class Admin
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$post) {
|
if (!$post) {
|
||||||
$post = isset($_POST['data']) ? $_POST['data'] : [];
|
$post = $this->grav['uri']->post();
|
||||||
|
$post = isset($post['data']) ? $post['data'] : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if a data type is plugin-provided, before looking into core ones
|
// Check to see if a data type is plugin-provided, before looking into core ones
|
||||||
|
|||||||
Reference in New Issue
Block a user