Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php |
— | — | @@ -73,6 +73,26 @@ |
74 | 74 | ); |
75 | 75 | return; |
76 | 76 | } |
| 77 | + |
| 78 | + // If we've activated the 'tag' option, check the arguments for validity. |
| 79 | + if ( !empty($actions['tag']) ) { |
| 80 | + $bad = false; |
| 81 | + foreach( $actions['tag']['parameters'] as $tag ) { |
| 82 | + $t = Title::makeTitleSafe( NS_MEDIAWIKI, 'tag-'.$tag ); |
| 83 | + if (!$t) { |
| 84 | + $bad = true; |
| 85 | + } |
| 86 | + |
| 87 | + if ($bad) { |
| 88 | + $wgOut->addHTML( $this->buildFilterEditor( |
| 89 | + wfMsgExt( 'abusefilter-edit-bad-tags', 'parse' ), |
| 90 | + $this->mFilter, |
| 91 | + $history_id |
| 92 | + ) ); |
| 93 | + return; |
| 94 | + } |
| 95 | + } |
| 96 | + } |
77 | 97 | |
78 | 98 | $newRow = get_object_vars($newRow); // Convert from object to array |
79 | 99 | |
Index: trunk/extensions/AbuseFilter/AbuseFilter.i18n.php |
— | — | @@ -216,6 +216,8 @@ |
217 | 217 | 'abusefilter-edit-export' => 'Export this filter to another wiki', |
218 | 218 | 'abusefilter-edit-syntaxok' => 'No syntax errors detected.', |
219 | 219 | 'abusefilter-edit-syntaxerr' => 'Syntax error detected: $1', |
| 220 | + 'abusefilter-edit-bad-tags' => 'One or more of the tags you specified is not valid. |
| 221 | +Tags should be short, and they should not contain special characters.', |
220 | 222 | |
221 | 223 | // Filter editing helpers |
222 | 224 | 'abusefilter-edit-builder-select' => 'Select an option to add it at the cursor', |