mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-04 20:36:03 +01:00
Fix XSS checking when empty content #1533
This commit is contained in:
@@ -658,7 +658,7 @@ class AdminController extends AdminBaseController
|
||||
// XSS Checks for page content
|
||||
$xss_whitelist = $this->grav['config']->get('security.xss_whitelist', 'admin.super');
|
||||
if (!$this->admin->authorize($xss_whitelist)) {
|
||||
$check_what = ['header' => $data['header'], 'content' => $data['content']];
|
||||
$check_what = ['header' => $data['header'], 'content' => isset($data['content']) ? $data['content'] : ''];
|
||||
$results = Security::detectXssFromArray($check_what);
|
||||
if (!empty($results)) {
|
||||
$this->admin->setMessage('<i class="fa fa-ban"></i> ' . $this->admin->translate('PLUGIN_ADMIN.XSS_ONSAVE_ISSUE'),
|
||||
|
||||
Reference in New Issue
Block a user