mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Filter parameters when loading/editing them
Re-opening of I8eb50d38c81b4e446c0f1dc03abc27122b8fa025 by Thiemo Kreuz. Bug: T189681 Change-Id: Iaeae672dca66ffc745054daabd6f0eae7dfbc648
This commit is contained in:
parent
fb9b947a67
commit
392f37d516
|
@ -805,7 +805,7 @@ class AbuseFilter {
|
|||
} else {
|
||||
$actionsByFilter[$prefix . $row->afa_filter][$row->afa_consequence] = [
|
||||
'action' => $row->afa_consequence,
|
||||
'parameters' => explode( "\n", $row->afa_parameters )
|
||||
'parameters' => array_filter( explode( "\n", $row->afa_parameters ) )
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1093,7 +1093,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
foreach ( $res as $actionRow ) {
|
||||
$thisAction = [];
|
||||
$thisAction['action'] = $actionRow->afa_consequence;
|
||||
$thisAction['parameters'] = explode( "\n", $actionRow->afa_parameters );
|
||||
$thisAction['parameters'] = array_filter( explode( "\n", $actionRow->afa_parameters ) );
|
||||
|
||||
$actions[$actionRow->afa_consequence] = $thisAction;
|
||||
}
|
||||
|
@ -1207,7 +1207,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
$parameters[1] = $request->getVal( 'wpBlockAnonDuration' );
|
||||
$parameters[2] = $request->getVal( 'wpBlockUserDuration' );
|
||||
} elseif ( $action == 'tag' ) {
|
||||
$parameters = explode( "\n", $request->getText( 'wpFilterTags' ) );
|
||||
$parameters = explode( "\n", trim( $request->getText( 'wpFilterTags' ) ) );
|
||||
}
|
||||
|
||||
$thisAction = [ 'action' => $action, 'parameters' => $parameters ];
|
||||
|
|
Loading…
Reference in a new issue