Project

General

Profile

« Previous | Next » 

Revision 54e81df0

Added by phildd over 11 years ago

Validate IP address ranges correctly on Alias Bulk Import

The code was there to attempt to validate and implement IP address range lines in Alias Bulk Import e.g.
10.20.0.0-10.21.22.0
should produce a bunch of smaller ranges with appropriate CIDRs.
This fixes the code so IP address ranges actually make it through into the resulting Alias.

View differences:

usr/local/www/firewall_aliases_import.php
1 1
<?php
2 2
/* $Id$ */
3 3
/*
4
	firewall_aliases_edit.php
4
	firewall_aliases_import.php
5 5
	Copyright (C) 2005 Scott Ullrich
6 6
	All rights reserved.
7 7

  
......
89 89
			if (is_iprange($impip)) {
90 90
				list($startip, $endip) = explode('-', $impip);
91 91
				$rangesubnets = ip_range_to_subnet_array($startip, $endip);
92
				$address .= implode(" ", $rangesubnets);
92
				$imported = array_merge($imported, $rangesubnets);
93 93
			} else if (!is_ipaddr($impip) && !is_subnet($impip) && !empty($impip)) {
94 94
				$input_errors[] = sprintf(gettext("%s is not an IP address. Please correct the error to continue"), $impip);
95 95
			} elseif (!empty($impip)) {

Also available in: Unified diff