From 82dab54b719bcfadf62945ca74dec2cb8c30ec49 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Fri, 30 Jul 2021 14:58:50 +0200 Subject: [PATCH] fix: [setting] Support of dot and spaces when redirecting to the setting --- templates/element/Settings/notice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/element/Settings/notice.php b/templates/element/Settings/notice.php index 5282837..9e79877 100644 --- a/templates/element/Settings/notice.php +++ b/templates/element/Settings/notice.php @@ -51,8 +51,8 @@ foreach (array_keys($mainNoticeHeading) as $level) { ], [ 'fields' => [ ['key' => 'name', 'label' => __('Name'), 'formatter' => function($name, $row) { - $settingID = $row['true-name']; - return sprintf('%s', h($settingID), h($settingID), h($name)); + $settingID = preg_replace('/(\.|\W)/', '_', h($row['true-name'])); + return sprintf('%s', $settingID, $settingID, h($name)); }], ['key' => 'setting-path', 'label' => __('Category'), 'formatter' => function($path, $row) { return '' . h(str_replace('.', ' ▸ ', $path)) . '';