From 9f6d92a25d6fce8ff3917cff3a736acd2f9312e2 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 12 Jan 2016 21:01:08 +0545 Subject: status_dhcp6_leases incorrect comparison operator rather than assignment. Also $dhcpv6leaseinlocaltime was also being re-used as the value part of the foreach - that looks not so good also. Even so, I think the old code would have worked by good luck - in the end $dhcpv6leaseinlocaltime is only compared to "yes" anyway, so if it ended up as unset, or some part of a sub-array of $config['dhcpdv6'] or... it still functioned like "no". I found this by a quick scan through the output of: find /usr -type f -exec grep -H "^[^(]*==" {} \; That returns a lot of other stuff, but the bad uses of "==" stand out. --- src/usr/local/www/status_dhcpv6_leases.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/status_dhcpv6_leases.php b/src/usr/local/www/status_dhcpv6_leases.php index e8259d4..e665049 100644 --- a/src/usr/local/www/status_dhcpv6_leases.php +++ b/src/usr/local/www/status_dhcpv6_leases.php @@ -119,11 +119,11 @@ function leasecmp($a, $b) { function adjust_gmt($dt) { global $config; - $dhcpv6leaseinlocaltime == "no"; + $dhcpv6leaseinlocaltime = "no"; if (is_array($config['dhcpdv6'])) { $dhcpdv6 = $config['dhcpdv6']; - foreach ($dhcpdv6 as $dhcpv6leaseinlocaltime) { - $dhcpv6leaseinlocaltime = $dhcpv6leaseinlocaltime['dhcpv6leaseinlocaltime']; + foreach ($dhcpdv6 as $dhcpdv6params) { + $dhcpv6leaseinlocaltime = $dhcpdv6params['dhcpv6leaseinlocaltime']; if ($dhcpv6leaseinlocaltime == "yes") { break; } -- cgit v1.1