Merge "Bug 43011 - AbuseFilter: Invalid argument supplied for foreach"

This commit is contained in:
Hoo man 2013-02-14 01:43:05 +00:00 committed by Gerrit Code Review
commit d6ae1d4576

View file

@ -1777,12 +1777,13 @@ class AbuseFilter {
# Process actions
$actions_raw = unserialize( $row->afh_actions );
$actions_output = array();
foreach ( $actions_raw as $action => $parameters ) {
$actions_output[$action] = array(
'action' => $action,
'parameters' => $parameters
);
if ( is_array( $actions_raw ) ) {
foreach ( $actions_raw as $action => $parameters ) {
$actions_output[$action] = array(
'action' => $action,
'parameters' => $parameters
);
}
}
return array( $af_row, $actions_output );