diff options
author | Ermal <eri@pfsense.org> | 2010-03-18 18:00:21 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-03-18 18:00:21 +0000 |
commit | cf895854c2e29caeaaab966c4abccf5f074feeee (patch) | |
tree | b6e82307bb79d0e3a04e20c4f92600fb8b3eb503 /etc/inc/filter.inc | |
parent | 30d98ad3ab01b8f74b530a0d5b22feeb056fdc75 (diff) | |
download | pfsense-cf895854c2e29caeaaab966c4abccf5f074feeee.zip pfsense-cf895854c2e29caeaaab966c4abccf5f074feeee.tar.gz |
Propperly handle large aliases and properly generate it on the config file so it does not error out.
Diffstat (limited to 'etc/inc/filter.inc')
-rw-r--r-- | etc/inc/filter.inc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index c787e33..2eba4ea 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -412,11 +412,12 @@ function filter_generate_nested_alias($name, $alias, &$aliasnesting, &$aliasaddr $addresses = split(" ", $alias); $finallist = ""; + $builtlist = ""; $aliasnesting[$name] = $name; foreach ($addresses as $address) { if (empty($address)) continue; - $linelength = strlen($finallist); + $linelength = strlen($builtlist); $tmpline = ""; if(is_alias($address)) { /* We already expanded this alias so there is no neccessity to do it again. */ @@ -430,9 +431,11 @@ function filter_generate_nested_alias($name, $alias, &$aliasnesting, &$aliasaddr $aliasaddrnesting[$address] = $address; $tmpline = " $address"; } - if((strlen($tmpline)+ $linelength) > 4036) - $finallist .= "\n"; - $finallist .= " {$tmpline}"; + if ((strlen($tmpline)+ $linelength) > 4036) { + $finallist .= "{$builtlist} \\\n"; + $builtlist = ""; + } + $builtlist .= " {$tmpline}"; } return $finallist; } |