summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static
diff options
context:
space:
mode:
authorDaniel Nilsson <daniel.nilsson94@outlook.com>2024-03-02 11:35:04 +0100
committerPaul Donald <itsascambutmailmeanyway@gmail.com>2024-03-07 19:52:22 +0100
commitc68ec2f910007c77874816fc0b829df78ca47aa0 (patch)
tree2b9a9f02cc9ee5d7788122f2132daa6b1980e943 /modules/luci-base/htdocs/luci-static
parent464c659a82050c2655f5f83539786ebf4b39264c (diff)
luci-base: use correct regex for time validation
Before this change, values further in time than 23:59:59 was allowed, such as 24:00:00 and 23:60:00. Leap seconds is accounted for so 60 is allowed in the seconds parameter. Signed-off-by: Daniel Nilsson <daniel.nilsson94@outlook.com>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/validation.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js
index e4f8c7a201..5719031cb7 100644
--- a/modules/luci-base/htdocs/luci-static/resources/validation.js
+++ b/modules/luci-base/htdocs/luci-static/resources/validation.js
@@ -563,7 +563,7 @@ var ValidatorFactory = baseclass.extend({
},
timehhmmss: function() {
- return this.assert(this.value.match(/^[0-6][0-9]:[0-6][0-9]:[0-6][0-9]$/),
+ return this.assert(this.value.match(/^(?:[01]\d|2[0-3]):[0-5]\d:(?:[0-5]\d|60)$/),
_('valid time (HH:MM:SS)'));
},