diff options
author | Anders Lind <anders.lind@gmail.com> | 2016-03-02 22:32:41 +0100 |
---|---|---|
committer | Anders Lind <anders.lind@gmail.com> | 2016-03-02 22:32:41 +0100 |
commit | e3e21e7094fef849419ab68f4699e12dc9bc00a4 (patch) | |
tree | 45cf98a8f2317394d09f8663d7f0eafe44f98adb /src/usr/local/www/status_dhcpv6_leases.php | |
parent | 0ce280674e4afecbb2f33b373cef453973bb0007 (diff) | |
download | pfsense-e3e21e7094fef849419ab68f4699e12dc9bc00a4.zip pfsense-e3e21e7094fef849419ab68f4699e12dc9bc00a4.tar.gz |
Update status_dhcpv6_leases.php
Fix lacking of incrementation of index when two characters have been passed.
Fix check of $n so that the octal value is checked as an octal value.
Diffstat (limited to 'src/usr/local/www/status_dhcpv6_leases.php')
-rw-r--r-- | src/usr/local/www/status_dhcpv6_leases.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/usr/local/www/status_dhcpv6_leases.php b/src/usr/local/www/status_dhcpv6_leases.php index 40e50e5..9b7f37e 100644 --- a/src/usr/local/www/status_dhcpv6_leases.php +++ b/src/usr/local/www/status_dhcpv6_leases.php @@ -162,9 +162,13 @@ function parse_duid($duid_string) { $n = substr($duid_string, $i+1, 1); if (($n == '\\') || ($n == '"')) { $parsed_duid[] = sprintf("%02x", ord($n)); - } elseif (is_numeric($n)) { - $parsed_duid[] = sprintf("%02x", octdec(substr($duid_string, $i+1, 3))); - $i += 3; + $i += 1; + } else { + $n = substr($duid_string, $i+1, 3); + if (preg_match('/[0-3][0-7]{2}/', $n)) { + $parsed_duid[] = sprintf("%02x", octdec($n)); + $i += 3; + } } } else { $parsed_duid[] = sprintf("%02x", ord($s)); |