mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-30 09:56:11 +01:00
Set defaults
This commit is contained in:
@@ -648,8 +648,7 @@ class AdminController extends AdminBaseController
|
|||||||
$route = '/' . ltrim($route, '/');
|
$route = '/' . ltrim($route, '/');
|
||||||
|
|
||||||
// XSS Checks for page content
|
// XSS Checks for page content
|
||||||
$xss_whitelist = $this->grav['config']->get('security.xss_whitelist', []);
|
$xss_whitelist = $this->grav['config']->get('security.xss_whitelist', 'admin.super');
|
||||||
|
|
||||||
if (!$this->admin->authorize($xss_whitelist)) {
|
if (!$this->admin->authorize($xss_whitelist)) {
|
||||||
if ($issue = Utils::detectXss($data['content'])) {
|
if ($issue = Utils::detectXss($data['content'])) {
|
||||||
$this->admin->setMessage(sprintf($this->admin->translate('PLUGIN_ADMIN.XSS_ISSUE'), $issue),
|
$this->admin->setMessage(sprintf($this->admin->translate('PLUGIN_ADMIN.XSS_ISSUE'), $issue),
|
||||||
@@ -658,10 +657,10 @@ class AdminController extends AdminBaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for valid frontmatter
|
||||||
if (isset($data['frontmatter']) && !$this->checkValidFrontmatter($data['frontmatter'])) {
|
if (isset($data['frontmatter']) && !$this->checkValidFrontmatter($data['frontmatter'])) {
|
||||||
$this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INVALID_FRONTMATTER_COULD_NOT_SAVE'),
|
$this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INVALID_FRONTMATTER_COULD_NOT_SAVE'),
|
||||||
'error');
|
'error');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user