From 553591d72c63c01a1453e395d68dbf1ac1d13358 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Tue, 9 Jul 2024 12:01:56 +0200 Subject: [PATCH] item-mixin: Improve Item name validation RegEx (#2658) `A-z` also matches `[ \ ] ^ _ `, which is not intended. Signed-off-by: Florian Hotze --- bundles/org.openhab.ui/web/src/components/item/item-mixin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.ui/web/src/components/item/item-mixin.js b/bundles/org.openhab.ui/web/src/components/item/item-mixin.js index 80fe39453..9f52621ff 100644 --- a/bundles/org.openhab.ui/web/src/components/item/item-mixin.js +++ b/bundles/org.openhab.ui/web/src/components/item/item-mixin.js @@ -39,7 +39,7 @@ export default { * @returns {string} The error message if the name is invalid, or an empty string if the name is valid. */ validateItemName (name) { - if (!/^[A-z][A-z0-9_]*$/.test(name)) { + if (!/^[A-Za-z][A-Za-z0-9_]*$/.test(name)) { return 'Required. Must not start with a number. A-Z,a-z,0-9,_ only' } else if (this.items && this.items.some(item => item.name === name)) { return 'An Item with this name already exists'