diff options
author | Phil Davis <phil.davis@inf.org> | 2017-01-08 20:53:15 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2017-01-08 20:53:15 +0545 |
commit | f4bbec8bf04aa22601cfdea2b9c7513cf01d9d79 (patch) | |
tree | 276ba1a0b08840461d5486f5a53f1b951a4a45ca /src/usr/local/www/system_advanced_network.php | |
parent | 7e33d908b155007e06281f07544e9ab26f357d6e (diff) | |
download | pfsense-f4bbec8bf04aa22601cfdea2b9c7513cf01d9d79.zip pfsense-f4bbec8bf04aa22601cfdea2b9c7513cf01d9d79.tar.gz |
Helper format_duid() for DUID input
Diffstat (limited to 'src/usr/local/www/system_advanced_network.php')
-rw-r--r-- | src/usr/local/www/system_advanced_network.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/usr/local/www/system_advanced_network.php b/src/usr/local/www/system_advanced_network.php index b99dad8..acfe18d 100644 --- a/src/usr/local/www/system_advanced_network.php +++ b/src/usr/local/www/system_advanced_network.php @@ -56,6 +56,14 @@ if ($_POST) { $input_errors[] = gettext("An IP address to NAT IPv6 packets must be specified."); } + if (!empty($_POST['global-v6duid'])) { + $_POST['global-v6duid'] = format_duid($_POST['global-v6duid']); + $pconfig['global-v6duid'] = $_POST['global-v6duid']; + if (!is_duid($_POST['global-v6duid'])) { + $input_errors[] = gettext("A valid DUID must be specified"); + } + } + ob_flush(); flush(); if (!$input_errors) { @@ -85,12 +93,7 @@ if ($_POST) { } if (!empty($_POST['global-v6duid'])) { - $_POST['global-v6duid'] = strtolower(str_replace("-", ":", $_POST['global-v6duid'])); - if (!is_duid($_POST['global-v6duid'])) { - $input_errors[] = gettext("A valid DUID must be specified"); - } else { - $config['system']['global-v6duid'] = $_POST['global-v6duid']; - } + $config['system']['global-v6duid'] = $_POST['global-v6duid']; } else { unset($config['system']['global-v6duid']); } |