Revision 6c07db48
Added by Phil Davis about 10 years ago
usr/local/www/firewall_aliases_edit.php | ||
---|---|---|
50 | 50 |
require_once("filter.inc"); |
51 | 51 |
require_once("shaper.inc"); |
52 | 52 |
|
53 |
$pgtitle = array(gettext("Firewall"),gettext("Aliases"),gettext("Edit"));
|
|
53 |
$pgtitle = array(gettext("Firewall"), gettext("Aliases"), gettext("Edit"));
|
|
54 | 54 |
|
55 | 55 |
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php'); |
56 | 56 |
|
... | ... | |
93 | 93 |
in_array($alias['type'], array("host", "network"))) { |
94 | 94 |
return true; |
95 | 95 |
} |
96 |
if ($type == $alias['type']) {
|
|
96 |
if ($type == $alias['type']) { |
|
97 | 97 |
return true; |
98 | 98 |
} else { |
99 | 99 |
return false; |
... | ... | |
194 | 194 |
$alias['updatefreq'] = $_POST['address_subnet0'] ? $_POST['address_subnet0'] : 7; |
195 | 195 |
if (!is_URL($alias['url']) || empty($alias['url'])) { |
196 | 196 |
$input_errors[] = gettext("You must provide a valid URL."); |
197 |
} elseif (! process_alias_urltable($alias['name'], $alias['url'], 0, true)) {
|
|
197 |
} elseif (!process_alias_urltable($alias['name'], $alias['url'], 0, true)) { |
|
198 | 198 |
$input_errors[] = gettext("Unable to fetch usable data."); |
199 | 199 |
} |
200 | 200 |
if ($_POST["detail0"] <> "") { |
... | ... | |
214 | 214 |
$desc_fmt_err_found = false; |
215 | 215 |
|
216 | 216 |
/* item is a url type */ |
217 |
for ($x=0; $x<$max_alias_addresses-1; $x++) {
|
|
217 |
for ($x = 0; $x < $max_alias_addresses - 1; $x++) {
|
|
218 | 218 |
$_POST['address' . $x] = trim($_POST['address' . $x]); |
219 | 219 |
if ($_POST['address' . $x]) { |
220 | 220 |
/* fetch down and add in */ |
... | ... | |
278 | 278 |
// Users can paste strings like "10.1.2.0/24 10.3.0.0/16 9.10.11.0/24" into an address box. |
279 | 279 |
// They can also put an IP range. |
280 | 280 |
// This loop expands out that stuff so it can easily be validated. |
281 |
for ($x=0; $x<($max_alias_addresses-1); $x++) {
|
|
281 |
for ($x = 0; $x < ($max_alias_addresses - 1); $x++) {
|
|
282 | 282 |
if ($_POST["address{$x}"] <> "") { |
283 | 283 |
if ($_POST["detail{$x}"] <> "") { |
284 | 284 |
if ((strpos($_POST["detail{$x}"], "||") === false) && (substr($_POST["detail{$x}"], 0, 1) != "|") && (substr($_POST["detail{$x}"], -1, 1) != "|")) { |
Also available in: Unified diff
Code spacing
and other random stuff I noticed.
I think this finishes messing with code style. The codebase should match
the developer style guide closely enough that 99.9% of changes will not
feel the need to also massage the formatting.