Fixed regex validation for IPv4 (e.g. 208.67.220.220 now works)

This commit is contained in:
Eric Schultz
2016-06-11 09:48:26 -05:00
parent d1b65ebc90
commit 62b296fcf2

View File

@@ -18,7 +18,7 @@ Png="ethernet.png"
$build = false;
$template = '/usr/local/emhttp/webGui/EthX.page';
$ini = '/var/local/emhttp/network.ini';
$validIP = '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
$validIP = '((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
// get available ethernet ports (excluding eth0)
exec("ip -br addr|grep -Po '^eth[1-9]+\s'",$ports);
@@ -233,7 +233,7 @@ function portcheck_eth0() {
}
function portToggle(port,cmd) {
$.post('/webGui/include/PortToggle.php',{port:port,cmd:cmd},function(){refresh();});
}
}
$(function() {
var ctrl = "<span id='wait_eth0' class='status red' style='display:none;font-size:small;font-style:italic'>Please wait... configuring interfaces</span>";
var form = document.eth0_settings;