From d6a36af4d5e07165d64fbb3d77f0b39be395ed8e Mon Sep 17 00:00:00 2001 From: Alexis Bouhet Date: Tue, 23 Oct 2018 15:17:43 +0200 Subject: [PATCH] Hotfix for admincontroller.php (#1533) Now checking if 'content' is in $data. Some blueprints can have 'content' optional so not defined, which cause a crash when editing. Checking with operator `??` and default value empty string `''`. --- classes/admincontroller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/admincontroller.php b/classes/admincontroller.php index 7bd45be3..a9eba49a 100644 --- a/classes/admincontroller.php +++ b/classes/admincontroller.php @@ -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' => $data['content'] ?? '']; $results = Security::detectXssFromArray($check_what); if (!empty($results)) { $this->admin->setMessage(' ' . $this->admin->translate('PLUGIN_ADMIN.XSS_ONSAVE_ISSUE'),