From: Jo-Philipp Wich Date: Mon, 3 Apr 2023 12:05:00 +0000 (+0200) Subject: luci-base: validation.js: fix xgettext quirk X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b07ac8add8f6d2081663341b55b999e4d9c59dcd;p=project%2Fluci.git luci-base: validation.js: fix xgettext quirk The xgettext utility does not properly discard `/` inside regex character classes, causing a false positive unterminated string error. Avoid the issue by explicitly escaping the embedded slash. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js index b7a3a140e4..791a84823d 100644 --- a/modules/luci-base/htdocs/luci-static/resources/validation.js +++ b/modules/luci-base/htdocs/luci-static/resources/validation.js @@ -432,7 +432,7 @@ var ValidatorFactory = baseclass.extend({ if (v == '.' || v == '..') return this.assert(false, _('valid network device name, not "." or ".."')); - return this.assert(v.match(/^[^:/%\s]{1,15}$/), _('valid network device name between 1 and 15 characters not containing ":", "/", "%" or spaces')); + return this.assert(v.match(/^[^:\/%\s]{1,15}$/), _('valid network device name between 1 and 15 characters not containing ":", "/", "%" or spaces')); }, range: function(min, max) {