Bug #2283
closedpfblocker array handling when alias table is empty
0%
Description
When pfblocker is not enabled or there is nothing setup for pfblocker to do, and there are no other aliases defined in the pfSense alias table, pfblocker.inc sync_package_pfblocker logs a PHP error when trying to process the empty alias table. The "if" test at:
#update pfsense alias table
if (is_array($config['aliases']['alias'])){
$aliases=$config['aliases']['alias'];
foreach($aliases as $cbalias){
...
}
}
needs to be a block that covers both statements above, as shown.
In the existing code the if test only applies itself to the 1 line immediately following it.
Otherwise the "foreach" line logs an error because $aliases is null.
This case applies equally to 2.0.n and 2.1
A sample corrected file is attached.
Files
Updated by Phillip Davis over 13 years ago
This was resolved by pull request 225 on 15 Mar 2012