luci-mod-system: change regex to please jsmin
authorPaul Donald <redacted>
Mon, 16 Feb 2026 01:49:03 +0000 (02:49 +0100)
committerPaul Donald <redacted>
Mon, 16 Feb 2026 01:49:37 +0000 (02:49 +0100)
Also trim out unused function

Signed-off-by: Paul Donald <redacted>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/repokeys.js

index 7785ee4320a7cd598c97ec7c3db206aee8872f25..c6dfcbdc4e3e0e347c3182eb6c36b4f6301171d8 100644 (file)
@@ -56,12 +56,6 @@ function listKeyFiles() {
        );
 }
 
-function safeText(str) {
-       return String(str).replace(/[&<>"']/g, s => ({
-               '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;'
-       }[s]));
-}
-
 function saveKeyFile(keyContent, file, fileContent) {
        const ts = Date.now();
        // Note: opkg can only verify against a key with filename that matches its key hash
@@ -92,7 +86,7 @@ function removeKey(ev, key) {
 }
 
 function isPemFormat(content) {
-       return new RegExp('-BEGIN ([A-Z ]+)?PUBLIC KEY-').test(content);
+       return (/-BEGIN ([A-Z ]+)?PUBLIC KEY-/.test(content));
 }
 
 function keyEnvironmentCheck(key) {
@@ -274,7 +268,7 @@ return view.extend({
                s = m.section(form.NamedSection, 'fup');
 
                o = s.option(form.DummyValue, '_newkey');
-               o.cfgvalue = function(section_id) {
+               o.cfgvalue = function(/* section_id*/) {
 
                        const addInput = E('textarea', {
                                id: 'key-input',
git clone https://git.99rst.org/PROJECT