Project

General

Profile

« Previous | Next » 

Revision 8c2a5a73

Added by Phil Davis over 10 years ago

Fix bracketing of if statement in unbound

Stops message:
Warning: in_array() expects parameter 2 to be array, null given in /etc/inc/unbound.inc on line 607
The problem was introduced when lines 607-608 were added without adding these brackets.
IMHO programming standards should include ALWAYS using brackets for "if" and other similar statements. That way this sort of code addition accident does not happen. But I guess there are others who have different opinions.

View differences:

etc/inc/unbound.inc
602 602
		$aclcfg = "access-control: 127.0.0.1/32 allow\n";
603 603
		$aclcfg .= "access-control: ::1 allow\n";
604 604
		// Add our networks for active interfaces including localhost
605
		if (!empty($config['unbound']['active_interface']))
605
		if (!empty($config['unbound']['active_interface'])) {
606 606
			$active_interfaces = array_flip(explode(",", $config['unbound']['active_interface']));
607 607
			if (in_array("all", $active_interfaces, true))
608 608
				$active_interfaces = get_configured_interface_with_descr();
609
		else
609
		} else
610 610
			$active_interfaces = get_configured_interface_with_descr();
611 611
	
612 612
		$bindints = "";

Also available in: Unified diff