From 1e2174bb802ac27d3afc3cf517497f0ae910bc41 Mon Sep 17 00:00:00 2001 From: SaltyMonkey <1570693+SaltyMonkey@users.noreply.github.com> Date: Sat, 12 Jul 2025 00:40:51 +0300 Subject: [PATCH] User Subnets validation: 0.0.0.0 is not allowed --- .../luci-static/resources/view/podkop/configSection.js | 5 ++++- luci-app-podkop/po/ru/podkop.po | 3 +++ luci-app-podkop/po/templates/podkop.pot | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/configSection.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/configSection.js index b0c181c..e2c2f51 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/configSection.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/configSection.js @@ -417,6 +417,9 @@ function createConfigSection(section, map, network) { const subnetRegex = /^(\d{1,3}\.){3}\d{1,3}(\/\d{1,2})?$/; if (!subnetRegex.test(value)) return _('Invalid format. Use format: X.X.X.X or X.X.X.X/Y'); const [ip, cidr] = value.split('/'); + if (ip === "0.0.0.0") { + return _('IP address 0.0.0.0 is not allowed'); + } const ipParts = ip.split('.'); for (const part of ipParts) { const num = parseInt(part); @@ -526,4 +529,4 @@ function createConfigSection(section, map, network) { return baseclass.extend({ createConfigSection -}); \ No newline at end of file +}); \ No newline at end of file diff --git a/luci-app-podkop/po/ru/podkop.po b/luci-app-podkop/po/ru/podkop.po index 84c6bf4..4da1f31 100644 --- a/luci-app-podkop/po/ru/podkop.po +++ b/luci-app-podkop/po/ru/podkop.po @@ -232,6 +232,9 @@ msgstr "Неверный формат URL. URL должен начинаться msgid "Invalid format. Use format: X.X.X.X or X.X.X.X/Y" msgstr "Неверный формат. Используйте формат: X.X.X.X или X.X.X.X/Y" +msgid "IP address 0.0.0.0 is not allowed" +msgstr "IP адрес не может быть 0.0.0.0" + msgid "IP address parts must be between 0 and 255" msgstr "Части IP-адреса должны быть между 0 и 255" diff --git a/luci-app-podkop/po/templates/podkop.pot b/luci-app-podkop/po/templates/podkop.pot index 45f4fbb..99e4554 100644 --- a/luci-app-podkop/po/templates/podkop.pot +++ b/luci-app-podkop/po/templates/podkop.pot @@ -232,6 +232,9 @@ msgstr "" msgid "Invalid format. Use format: X.X.X.X or X.X.X.X/Y" msgstr "" +msgid "IP address 0.0.0.0 is not allowed" +msgstr "" + msgid "IP address parts must be between 0 and 255" msgstr ""