From 0dea6e5760057f86ec6695f9f29e3a575e6b41a9 Mon Sep 17 00:00:00 2001 From: Thomas Jakobi Date: Fri, 1 Dec 2023 10:46:29 +0100 Subject: [PATCH] Trim the context setting key during creating a new context setting --- core/model/modx/processors/context/setting/create.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/model/modx/processors/context/setting/create.class.php b/core/model/modx/processors/context/setting/create.class.php index b78181bffe4..8f8f6d34d17 100644 --- a/core/model/modx/processors/context/setting/create.class.php +++ b/core/model/modx/processors/context/setting/create.class.php @@ -54,7 +54,7 @@ public function initialize() { public function beforeSave() { $this->object->set('context_key', $this->context->key); - $key = $this->getProperty('key'); + $key = trim($this->getProperty('key', '')); $this->object->set('key', $key); // Make sure the key's there and valid