Index: trunk/extensions/AbuseFilter/AbuseFilterVariableHolder.php |
— | — | @@ -187,7 +187,7 @@ |
188 | 188 | $interest_lines[] = substr( $line, strlen($line_prefix) ); |
189 | 189 | } |
190 | 190 | } |
191 | | - $result = implode( "\n", $interest_lines ); |
| 191 | + $result = $interest_lines; |
192 | 192 | break; |
193 | 193 | case 'links-from-wikitext': |
194 | 194 | $article = self::articleFromTitle( $parameters['namespace'], |
— | — | @@ -197,7 +197,7 @@ |
198 | 198 | $new_text = $vars->getVar( $textVar )->toString(); |
199 | 199 | $editInfo = $article->prepareTextForEdit( $new_text ); |
200 | 200 | $links = array_keys( $editInfo->output->getExternalLinks() ); |
201 | | - $result = implode( "\n", $links ); |
| 201 | + $result = $links; |
202 | 202 | break; |
203 | 203 | case 'links-from-wikitext-nonedit': |
204 | 204 | case 'links-from-wikitext-or-database': |
— | — | @@ -216,7 +216,7 @@ |
217 | 217 | $links = array_keys( $editInfo->output->getExternalLinks() ); |
218 | 218 | } |
219 | 219 | |
220 | | - $result = implode( "\n", $links ); |
| 220 | + $result = $links; |
221 | 221 | break; |
222 | 222 | case 'link-diff-added': |
223 | 223 | $oldLinkVar = $parameters['oldlink-var']; |
— | — | @@ -229,7 +229,7 @@ |
230 | 230 | $newLinks = explode( "\n", $newLinks ); |
231 | 231 | |
232 | 232 | $added = array_diff( $newLinks, $oldLinks ); |
233 | | - $result = implode( "\n", $added ); |
| 233 | + $result = $added; |
234 | 234 | break; |
235 | 235 | case 'link-diff-removed': |
236 | 236 | $oldLinkVar = $parameters['oldlink-var']; |
— | — | @@ -242,7 +242,7 @@ |
243 | 243 | $newLinks = explode( "\n", $newLinks ); |
244 | 244 | |
245 | 245 | $removed = array_diff( $oldLinks, $newLinks ); |
246 | | - $result = implode( "\n", $removed ); |
| 246 | + $result = $removed; |
247 | 247 | break; |
248 | 248 | case 'parse-wikitext': |
249 | 249 | $article = self::articleFromTitle( $parameters['namespace'], $parameters['title'] ); |
— | — | @@ -290,7 +290,7 @@ |
291 | 291 | while ($user = $dbr->fetchRow($res)) { |
292 | 292 | $users[] = $user[0]; |
293 | 293 | } |
294 | | - $result = implode( ", ", $users ); |
| 294 | + $result = $users; |
295 | 295 | break; |
296 | 296 | case 'get-page-restrictions': |
297 | 297 | $action = $parameters['action']; |
— | — | @@ -298,7 +298,7 @@ |
299 | 299 | |
300 | 300 | $rights = $title->getRestrictions( $action ); |
301 | 301 | $rights = count($rights) ? $rights : array(); |
302 | | - $result = implode(',', $rights ); |
| 302 | + $result = $rights; |
303 | 303 | break; |
304 | 304 | case 'simple-user-accessor': |
305 | 305 | $user = $parameters['user']; |
— | — | @@ -334,7 +334,7 @@ |
335 | 335 | case 'user-groups': |
336 | 336 | $user = $parameters['user']; |
337 | 337 | $obj = self::userObjectFromName( $user ); |
338 | | - $result = implode(',', $obj->getEffectiveGroups() ); |
| 338 | + $result = $obj->getEffectiveGroups(); |
339 | 339 | break; |
340 | 340 | case 'length': |
341 | 341 | $s = $vars->getVar( $parameters['length-var'] )->toString(); |
Index: trunk/extensions/AbuseFilter/tests/wptest2.t |
— | — | @@ -3,8 +3,8 @@ |
4 | 4 | new_size_test := 100;
|
5 | 5 | article_namespace_test := 0;
|
6 | 6 | edit_delta_test := -22;
|
7 | | -added_lines_test := '<ref name="bah">test</ref> test2!';
|
8 | | -removed_lines_test := '<ref name="bah">test</ref><ref name="wah">test2</ref>';
|
| 7 | +added_lines_test := ['<ref name="bah">test</ref> test2!'];
|
| 8 | +removed_lines_test := ['<ref name="bah">test</ref><ref name="wah">test2</ref>'];
|
9 | 9 |
|
10 | 10 | !("autoconfirmed" in user_groups_test)
|
11 | 11 | /* this edit_delta ignores large blankings that are treated by another filter */
|
— | — | @@ -18,4 +18,4 @@ |
19 | 19 | /*Excludes changing to the named reference format and removing closing tags attached to formerly named refs. Unequality is to account for closing the first named tag */
|
20 | 20 | & !(rcount("<ref>",removed_lines_test) = rcount("<ref\sname",added_lines_test) | rcount("</ref>",removed_lines_test) <= rcount("<ref\sname",added_lines_test))
|
21 | 21 | /*Excludes removal of references to Wikipedia itself */
|
22 | | -& !(count("http://en.wikipedia.org",removed_lines_test) > count("http://en.wikipedia.org",added_lines_test))
|
| 22 | +& !(count("http://en.wikipedia.org",string(removed_lines_test)) > count("http://en.wikipedia.org",string(added_lines_test)))
|
Index: trunk/extensions/AbuseFilter/tests/wptest3.t |
— | — | @@ -1,11 +1,11 @@ |
2 | 2 | /* Filter 18 from English Wikipedia (test type edits from clicking on edit bar) */
|
3 | 3 | user_groups_test := ["*"];
|
4 | 4 | article_namespace_test := 0;
|
5 | | -added_lines_test := "Hello world! '''Bold text''' [http://www.example.com link title]";
|
| 5 | +added_lines_test := ["Hello world! '''Bold text''' [http://www.example.com link title]"];
|
6 | 6 |
|
7 | 7 | (article_namespace_test == 0) &
|
8 | 8 | !("autoconfirmed" in user_groups_test) &
|
9 | | -(contains_any(added_lines_test,
|
| 9 | +(contains_any(string(added_lines_test),
|
10 | 10 | "'''Bold text'''",
|
11 | 11 | "''Italic text''",
|
12 | 12 | "[[Link title]]",
|