From 2dc1fccbd1f46d3fa2689cc1eae3899e5a807a4f Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Wed, 31 Jan 2024 02:04:27 +0100 Subject: [PATCH] luci-base: Code quality fixes reduce backtracking in regex Signed-off-by: Paul Donald --- modules/luci-base/htdocs/luci-static/resources/validation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js index 791a84823d4c..9504e7f2c426 100644 --- a/modules/luci-base/htdocs/luci-static/resources/validation.js +++ b/modules/luci-base/htdocs/luci-static/resources/validation.js @@ -589,7 +589,7 @@ var ValidatorFactory = baseclass.extend({ }, hexstring: function() { - return this.assert(this.value.match(/^([a-f0-9][a-f0-9]|[A-F0-9][A-F0-9])+$/), + return this.assert(this.value.match(/^([A-F0-9]{2})+$/i), _('hexadecimal encoded value')); },