Commit graph

318 commits

Author SHA1 Message Date
Hoo man a885db279d Merge "Let AbuseFilter work with 1.19" 2013-01-09 01:42:29 +00:00
CSteipp b8b799630b Merge "Properly integrate $wgAbuseFilterValidGroups" 2013-01-07 23:01:48 +00:00
csteipp 586598b5b2 Let AbuseFilter work with 1.19
This patch allows the current AbuseFilter to work with 1.19, by only
using MWTimestamp if MediaWiki is version 1.20 or later.

Api still needs fixing, but this will get filters running.

Change-Id: I7c9eaf777d529ce15dfd85761784f9ad1443f2bf
2013-01-07 14:53:57 -08:00
Matthias Mullie 0c174aec42 Properly integrate $wgAbuseFilterValidGroups
The concept of different AbuseFilter groups had not properly been integrated, but should be now:
- The total number of matches is now group-specific
- .. Which will also fix the emergency shutdown calculations
- And a portion of incorrect code (involving $logged_local_filters) has been fixed (action != group)

Change-Id: I091199a9d74aee47dcb3d8942394a28e0ffd3234
2013-01-07 14:42:51 +01:00
CSteipp 452b918203 Merge "Add hooks to AF that allow altering User and Title specific vars" 2013-01-03 20:38:59 +00:00
techman224 192f2e250e Hidden the test subpage in the navlinks for those without modify rights
The link should not be shown to users that don't have the right to use it,
like with the tools and import pages

Change-Id: Ie48e61a7de61ab095d621845466aea56b7445f5a
2012-12-30 15:23:36 -06:00
Marius Hoch 9fa6ef5a95 Add hooks to AF that allow altering User and Title specific vars
Added two hooks to the AbuseFilter, one that allows altering of the
variables created for a specific user and one for title specific
variables. This a much cleaner way to add title or user specific
variables than using the current general-purpose hooks.

Change-Id: I7374846346dd220b5d0633c11c134030f98bcf00
2012-12-28 00:40:48 +01:00
Krenair c7a617f24d (bug 43105) Don't send HTML to the IRC feeds
Change-Id: Idcbcf1f194f2fc1bdd10fefab570849a72ed30e7
2012-12-22 19:05:51 +00:00
Hoo man 253812a2f4 Merge "(bug 22548) add boolean user_blocked variable" 2012-12-18 19:09:32 +00:00
Kunal Mehta f97df950d7 Add option to have private filters notify UDP/RC (default: disabled)
Change-Id: I7e54f1da9f01634791316e613e79b2b7740f9760
2012-12-16 17:09:30 +01:00
Kunal Mehta 2b01494cfc (bug 22548) add boolean user_blocked variable
Change-Id: I8b61ce42338596a38e411d6023c8f7ff963641a1
2012-12-14 04:32:37 -06:00
Ori Livneh 90791cb24e Fix class name
Change-Id: If300aad2c3acf4d007e80a11158419c315c800e4
2012-12-13 15:59:54 -08:00
Kunal Mehta 578bc116e0 Don't send private filter hits to IRC/UDP
Change-Id: I433aa0d92f7bf805ea27eaf235909065e4d478a7
2012-12-13 04:29:16 -06:00
jeblad ae2c2f7e67 (Bug 42064) Change getText to getContent in AbuseFilter
Patchset 2: Handle more content types
Patchset 3: Change cover letter
Patchset 4: Make it b/c
Patchset 5: Refactor and use previous audience
Patchset 6: Fixed/ minor changes

Change-Id: Ib1d2f9803bc95bb9efd445e3778126d5c3090a71
2012-11-25 18:09:47 +01:00
Hoo man d2568a7d43 Merge "fix php notices" 2012-11-02 19:57:52 +00:00
Kaldari 6e3c9e4acf Merge "Bug 40672 - Abuse filter: Increase 5% limit to allow filtering for very short posts" 2012-10-25 18:22:52 +00:00
Matthias Mullie 1706ca0832 Bug 40672 - Abuse filter: Increase 5% limit to allow filtering for very short posts
This patchset will make it possible for other extensions to tap into abusefilter with a custom group, and set different tresholds per group.
See https://gerrit.wikimedia.org/r/#/c/29569/

Change-Id: I21d31bdf28e26f3c830652efc08a247db9f7a86c
2012-10-25 20:21:19 +02:00
raymond 7347c5d728 Add existing page/file restrictions
Already shown with the code but without text:
i.e. https://commons.wikimedia.org/w/index.php?title=Special:AbuseFilter/examine/82786829&testfilter=

PS2: Add message documentation

Change-Id: Ibb23bf556e8702dcd592e7a9b0ff3c851f83380c
2012-10-25 18:02:57 +02:00
Siebrand Mazeland 176227e721 Maintenance for AbuseFilter extension.
* Replace deprecated methods.
* Remove no longer needed function fnmatch().
* Remove superfluous newlines.
* Remove unused and redundant local variables and globals.
* Deglobalization.
* Update documentation.
* Fix incorrect return values or add FIXMEs when in doubt.
* Escape output in a few places where needed.
* Remove unneeded MEDIAWIKI constant checks.
* Fix various JSHint/JSLint issues.

Patch Set 11: Merged https://gerrit.wikimedia.org/r/24701 into
this one per Siebrand's request

Change-Id: I02ba4ce31b6aca5b7324114093f8ece143abc295
2012-10-09 22:26:45 +02:00
Matthias Mullie 457c38cc3a fix php notices
Change-Id: I44ec2181ac7f2aea775f17c162838d52524084f8
2012-09-27 12:15:22 +02:00
Siebrand b7ca16003a Merge "(bug 20272) AbuseFilter does not handle autocreation of accounts." 2012-09-23 18:21:26 +00:00
Krenair 4804699e70 (bug 30324#c9) Remove 'autoblock' log params for blocks
Change-Id: I86bd5fa949a06eed95708d7f1948b684251788bd
2012-09-21 16:26:02 +01:00
Werdna d34b3659d9 Merge "(bug 30324) Don't falsely claim to angry-autoblock in log entries, don't stop talk page access." 2012-09-16 13:14:15 +00:00
Krenair c3bd782ce5 (bug 30324) Don't falsely claim to angry-autoblock in log entries, don't stop talk page access.
Also autoblock.

Change-Id: I0563944752f2c5b536b6d05d74c0814183afe9de
2012-09-09 14:12:13 +01:00
raymond dabc66a883 Replace non standard 'tt' with 'code' for better HTML5 conformity
See http://www.w3.org/wiki/HTML/Elements/tt

Change-Id: Ia2ffb09c002bc3aededfb6bcb8a430da32b52cde
2012-09-07 10:50:13 +02:00
csteipp 1973ea6714 Add Global Rules
* Update rules list view to show global rules toggle, global rules
* Update rule processing to get global rules from memcache, if no
rule exists, get them from the central database and store them in
memcache
* Delete global rule key whenever global rules are updated
* Add filtering for log by wiki on the central database, updated
table definitions to add index on afl_wiki
* Add global $wgAbuseFilterDisallowGlobalLocalBlocks so local wikis
can prevent global rules from locally blocking, removing or revoking
permissions.

* patchset 13: Include recommendations from Tim. Add db updates to
LoadExtensionSchemaUpdates hook.
* patchset 14: forgot to add new files

Change-Id: Id69a9d603f9679f838e8691c651a3e9d8461b422
2012-08-27 03:30:07 +00:00
csteipp 56ca593a71 Add global throttling to AbuseFilter
Adds/checks keys to central memcache instance on throttle actions
to allow for global throttling of events.

Change-Id: Ic4ace6c4aa07990671fe75fbbc1b019a8395fc46
2012-08-16 16:01:19 -07:00
Reedy 268f976a12 Warning: Invalid argument supplied for foreach() in /usr/local/apache/common-local/php-1.20wmf8/extensions/AbuseFilter/AbuseFilter.class.php on line 1852
Change-Id: I9a00f341be161a8b33ff7a482a4f32f5b98b8716
2012-07-24 17:59:50 +00:00
Andrew Garrett 31dba52a94 AbuseFilter: Fix bug in 53aea9c where two log entries would be produced, one of them broken.
Change-Id: I075dce25756683ab4c04edab5f43ba451376ff6d
2012-07-24 10:55:58 -07:00
Reedy fad1fe4c41 Call to a member function getVars() on a non-object in SpecialAbuseLog.php on line 284
Seen on wmf fatal log

Change-Id: I50eb4f9d1b19c8c39ede07e1149baf475cccaaaf
2012-07-24 14:50:01 +01:00
Andrew Garrett 53aea9c0ce AbuseFilter: Resolve bug 18374, bug 28633.
* Store the revision ID associated with a log entry
 if the action is successful.
* Expose this as a diff link in the UI.
* Implicitly hide log entries if their
 corresponding revisions are also hidden.
* Includes scope for expanding to log entries if desired.

Change-Id: Ie2d43dd1bacf14289fdf0492bb22267590ee649d
2012-07-11 10:16:59 -04:00
Reedy 3da992692c Add a few bits of method documentation
De-indent a line

Tidy up method returns

Change-Id: I7aa93072c80a16eb27b7f7ac3d2f030ea63ebf60
2012-06-21 14:32:05 +01:00
Catrope c2869a28fd Merge "Abuse Filter: Allow filters to be split into "groups" for the purposes of operating them on different types of input." 2012-05-14 18:47:12 +00:00
Andrew Garrett dc207d0cbd Abuse Filter: Allow filters to be split into "groups" for the purposes of operating them on different types of input.
The purpose of this change is to allow AFTv5 developers to run a separate list of filters against article feedback actions without issues of cross-contamination and bumping up against the condition limit.

Change-Id: I758795f01eaf3ff56c5720d660cd989ef95764a7
2012-05-12 12:53:32 +10:00
Szymon Świerkosz 36257344f1 (bug 20272) AbuseFilter does not handle autocreation of accounts.
This change depends on I92f57fc2c3189c42157478de14a8d48045a253b5.

This change provides a handler for AbortAutoAccount hook and adds new
action to the filter: autocreateaccount. Every time the AbortAutoAccount
is invoked the filter is executed. This may create some issues with
users which are affected by a filter, because it may be triggered on
every page view. The AbuseFilter relies on CentralAuth session
blacklisting - for each session the filter will be triggered only
once and then the autocreationg of account will not be attempted.

I don't know why AbortNewAccount hook takes as $message argument
a text of message, however AbortAutoAccount takes a name of the
message. This makes impossible to produce a user friendly message
why account creation is not allowed.

Change-Id: Ie3a7ee9210fd884d214ad3132a502a00332c3138
2012-05-10 10:08:48 +02:00
Szymon Świerkosz fb01065583 Replace a deprecated wfGetIP() call with $wgRequest->getIP()
Change-Id: Iad77e7e352afb0d7e065769048ed1d1da25cf867
2012-05-08 09:50:11 +02:00
Szymon Świerkosz 93b7990fa3 (bug 18080) Send filter hits and changes to irc.wikimedia.org.
I have introduced a new option $wgAbuseFilterNotifications which
allows to configure the extension to send hit notifications to
Special:RecentChanges or UDP. It uses ManualLogEntry class:
ManualLogEntry->publish( 0, $wgAbuseFilterNotifications )

Log entries are _not_ accessible using Special:Log, that's bug 19494.

Change-Id: Ie4bda2f97aa295c0504ba869ef1a99c7a3d20f70
2012-05-04 16:45:19 +02:00
Sam Reed 8417c901f7 Few more types top flesh out the previous revisions
Change-Id: I1215dcf92f1b64e744c9ab41e0c5c046114dd48c
2012-03-26 16:03:23 +02:00
Sam Reed 69e582dc17 More documentation stubs
Fix Html::inputLabel to Xml::inputLabel

Fix up some deprecated code

Change-Id: If6503b1794d89666206802591094949e5d715ac1
2012-03-26 16:03:23 +02:00
Sam Reed bea9cb0874 A LOT of function level documentation
Change-Id: I8b591be3c2da7cfb29d3be026772816d14037d37
2012-03-26 16:03:22 +02:00
Roan Kattouw 6c4bd57043 Revert r111217 (unreviewed rev in AbuseFilter) and its dependencies r113585, r113587, r113588, r113589.
All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
2012-03-21 19:41:11 +00:00
Sam Reed 06e4721b80 Few more types top flesh out the previous revisions 2012-03-11 21:01:29 +00:00
Sam Reed 05a9d4d061 More documentation stubs
Fix Html::inputLabel to Xml::inputLabel

Fix up some deprecated code
2012-03-11 20:51:54 +00:00
Sam Reed 0c99b2bc15 A LOT of function level documentation 2012-03-11 20:40:04 +00:00
Sam Reed 857ae7c546 Bug 35156 - Harmonise spelling of getArticleID() and getArticleId()
Mass change ->getArticleId() to ->getArticleID()
2012-03-11 19:04:37 +00:00
Chad Horohoe 96e4807e08 Actually fix whitespace from r111202, only 83 characters => no need for silly indentation 2012-03-02 22:02:40 +00:00
Andrew Garrett 452ed4ed64 Armour page titles in MD5 when putting information about AbuseFilter warnings in the session. Resolves bug 26635. 2012-02-10 23:45:04 +00:00
Andrew Garrett 5e4289ce4e AbuseFilter: Resolve bugs 18374, 28633.
* Store the revision ID associated with a log entry if the action is successful.
* Expose this as a diff link in the UI.
* Implicitly hide log entries if their corresponding revisions are also hidden.
* Includes scope for expanding to log entries if desired.
2012-02-10 23:41:05 +00:00
Andrew Garrett 9aa60b4ace Fix whitespace 2012-02-10 21:36:31 +00:00
Andrew Garrett fb41b28dbf Revert formatting changes in r111131 2012-02-10 18:20:41 +00:00
Andrew Garrett 624426c490 AbuseFilter: Do not show the syntax checking / boxes / etc if the user cannot edit.
* Resolves bug 20472.
* Patch by EdoDodo with modifications.
2012-02-10 00:26:39 +00:00
Robin Pepermans c103fac20f It's better to set directionality in html than in css. Also fixes bug 34297, because the css only affected the edit form and not the test form.
Also add a bit of docs.
2012-02-09 17:00:34 +00:00
Tim Weyer c9c2a803ae Use no message when removing rights because \n will be replaced by the 'rightsnone' message if nothing follows 2012-01-20 12:53:02 +00:00
Mark A. Hershberger 4e8be82722 Bug 33380 - Details of actions caught by a private filter should be private
Author: Nikola Kovacs

Hide private information from logs
2012-01-03 17:29:10 +00:00
Mark A. Hershberger 504d830106 Revert r107454 based on concerns raised by Prodego. 2011-12-28 00:48:15 +00:00
Mark A. Hershberger 8e81b37871 Fix Bug 33380 - Details of actions caught by a private filter should be private
Author: Nikola Kovacs

Related patch on r107451
2011-12-28 00:26:13 +00:00
John Du Hart 7cf809bb0e Changes from r103817 2011-11-22 16:08:18 +00:00
John Du Hart 453af554b9 Added context where possible to main AbuseFilter class
Most of the rest cannot get a context since it originates from hooks with no context sources. Instead of just getting the main context we might as well wait for a proper solution.
2011-11-17 00:55:53 +00:00
Alexandre Emsenhuber 675e4c673a * (bug 29092) Removed usage of $wgArticle from AbuseFilter extension
Instead pass the Article object from the EditFilterMerged hook to the AFComputedVariable object and see whether the object is present to do a parse operation since other code paths won't pass an Article object

Also simplified the fallback code in AFComputedVariable::compute() to simply continue instead of calling the function again.
2011-11-09 08:36:26 +00:00
Alexander K. 4e133035b8 Followup r102138 -- fixes according to Werdna's comment 2011-11-06 21:05:03 +00:00
Alexander K. f128bd5931 Allow to define custom actions and their callback functions 2011-11-06 01:15:55 +00:00
Victor Vasiliev 9075e03709 * (bug 24109) Add regex escaping function to abuse filter 2011-10-18 17:54:25 +00:00
Roan Kattouw 49525acfc5 Switch to using canonical URLs where appropriate in various extensions
* ActiveAbstract: output is stored XML, as I understand it, so use canonical URLs throughout
* AbuseFilter: URLs go into log entries and need to be fully-qualified for the format to work
* EmailCapture: URLs go into e-mails
* SecurePoll: one URL goes to an XML file, make that one canonical. Made the URLs identifying users canonical too, because they would otherwise change when $wgServer is made protocol-relative and possibly break SecurePoll. Of course this means SP might still break if and when we change $wgCanonicalServer to point to HTTPS, but we'll worry about that later
* DoubleWiki: the surrounding code looks scary, but from what I can tell it seems to assume the URL starts with a protocol, then derive some data from it and put it in memcached. That means a canonical URL is needed so the protocol assumption is still valid and the cache isn't polluted
* OAI: use canonical URLs throughout
* LiquidThreads: use canonical URL in e-mail
2011-08-29 12:33:53 +00:00
John Du Hart b30697e94c Adds ResourceLoader support to AbuseFilter
Rewrote javascript to use jQuery
Added API modules to replace sajax_* calls
Solves bug 29714
2011-08-26 20:12:34 +00:00
Sam Reed a9e738f099 More document
Few minor code improvements
2011-08-24 22:11:52 +00:00
John Du Hart 0f274e5b32 (bug 30444) Add variables user_name and user_groups for action createaccount. Patch by Beau 2011-08-24 00:29:26 +00:00
Sam Reed 65981f0edb Swap else if for elseif
Trimming trailing whitespace also
2011-06-17 16:25:46 +00:00
Raimond Spekking 5dfc27d3c3 Show navigation bar as subtitle as all other navbars too for consistency 2011-04-29 14:48:33 +00:00
Happy-melon 9a2a9b919a Blame hashar for this giant commit; he teased me for making so many smaller ones earlier... :D
* Internalise $mAddress/$mUser, $mBy/$mByName, $mEnableAutoblock, $mId as getTarget(), getBlockers(), isAutoblocking(), getId().  
* This required editing AbuseFilter and CheckUser backwards-incompatibly, so push the rest of the changes out to those extensions.
* Attack the evil 14-parameter constructor and gratuitously-confusing newFromDB( $notVeryImportantParameter, $moreImportantParameter)
* Reimplement the hack for bug 13611 in a slightly less fragile fashion; could still do with further cleanup, but then again the login frontend is its own can of worms... :S
* Remove transitionary getTargetAndType() and newFromTargetAndType() methods
* Some optimisation in parseTarget()
* Fix the broken phpunit test mentioned in r84251
2011-03-21 19:12:41 +00:00
Happy-melon 12e1428629 * Implement an extensible Block::prevents( <action> ) function to replace the plethora of direct member variable accesses This pushes the historic *disable*-createaccount-vs-*allow* usertalk-edit wierdness down to the database layer
* Implement accessors for isHardblock() and getRangeStart()/getRangeEnd() in the same fashion.
* Make the corresponding variables private, removing external accessors.  This required updating AbuseFilter with non-B/C code, so I also implemented the rest of the changes I've made to the blocking backend in that extension.
* Move the "get an IP range which encompasses the given IP/range" logic to Block.php; will be needed later... :D
2011-03-19 23:47:08 +00:00
Happy-melon 13facb1a2d First forays into the swamp of the Block.php backend:
* Move Block::parseExpiryInput() to the frontend SpecialBlock::parseExpiryInput()
* consolidate the several implementations of the MediaWiki:Ipblockoptions parsing into SpecialBlock::getSuggestedDurations()
2011-03-18 16:35:22 +00:00
Sam Reed 6d548203f7 Parameter and Return Type hints 2011-02-10 17:32:57 +00:00
Sam Reed 6b782a96dd while to foreach
Remove unused variables

Condense css
2011-02-10 17:25:25 +00:00
Sam Reed 6098610527 Another big cull on unused variables and such 2010-10-29 21:55:29 +00:00
Sam Reed 961f512452 More deprecated method call removals and updates 2010-10-29 15:32:44 +00:00
Sam Reed cf800e4c18 Start removing/fixing calls to deprecated methods in WMF used extensions 2010-10-29 15:14:44 +00:00
Jack Phoenix 5e0330c6cc AbuseFilter: coding style tweaks, changed some while loops to foreach (as per http://www.mediawiki.org/wiki/Manual:Coding_conventions#Assignment_expressions) and added __METHOD__ to one DB query 2010-08-19 21:12:09 +00:00
Sam Reed 6981886b50 Nuke some more unused globals 2010-07-24 21:12:27 +00:00
Andrew Garrett c7f1b42b9e Fix bug 24167 2010-06-28 20:10:09 +00:00
Aryeh Gregor ed5b83e6ac Remove most named character references from output
Recommit of r66254 to trunk.  This was just

find extensions phase3 -iname '*.php' \! -iname '*.i18n.php' \! -iname 'Messages*.php' \! -iname '*_Messages.php' -exec sed -i 's/&nbsp;/\&#160;/g;s/&mdash;/―/g;s/&bull;/•/g;s/&aacute;/á/g;s/&acute;/´/g;s/&agrave;/à/g;s/&alpha;/α/g;s/&auml;/ä/g;s/&ccedil;/ç/g;s/&copy;/©/g;s/&darr;/↓/g;s/&deg;/°/g;s/&eacute;/é/g;s/&ecirc;/ê/g;s/&euml;/ë/g;s/&egrave;/è/g;s/&euro;/€/g;s/&harr;//g;s/&hellip;/…/g;s/&iacute;/í/g;s/&igrave;/ì/g;s/&larr;/←/g;s/&ldquo;/“/g;s/&middot;/·/g;s/&minus;/−/g;s/&ndash;/–/g;s/&oacute;/ó/g;s/&ocirc;/ô/g;s/&oelig;/œ/g;s/&ograve;/ò/g;s/&otilde;/õ/g;s/&ouml;/ö/g;s/&pound;/£/g;s/&prime;/′/g;s/&Prime;/″/g;s/&raquo;/»/g;s/&rarr;/→/g;s/&rdquo;/”/g;s/&Sigma;/Σ/g;s/&times;/×/g;s/&uacute;/ú/g;s/&uarr;/↑/g;s/&uuml;/ü/g;s/&yen;/¥/g' {} +

followed by reading over every single line of the resulting diff and
fixing a whole bunch of false positives.  The reason for this change is
given in <http://lists.wikimedia.org/pipermail/wikitech-l/2010-April/047617.html>.
I cleared it with Tim and Brion on IRC before committing.  It might
cause a few problems, but I tried to be careful; please report any
issues.

I skipped all messages files.  I plan to make a follow-up commit that
alters wfMsgExt() with 'escapenoentities' to sanitize all the entities.
That way, the only messages that will be problems will be ones that
output raw HTML, and we want to get rid of those anyway.

This should get rid of all named entities everywhere except messages.  I
skipped a few things like &nbsp that I noticed in manual inspection,
because they weren't well-formed XML anyway.

Also, to everyone who uses non-breaking spaces when they could use a
normal space, or nothing at all, or CSS padding: I still hate you.  Die.
2010-05-30 17:33:59 +00:00
Chad Horohoe 5fce797b18 Revert r66934 (Removing wfLoadExtensionMessages() from everything). I disagree on principle...we branch extensions for this very reason. But people want trunk extensions compatible for several versions back, meh. 2010-05-27 15:56:53 +00:00
Chad Horohoe 3283b90f01 Large commit. Removed 800+ references to no-op wfLoadExtensionMessages() 2010-05-26 22:25:32 +00:00
X! 0884d56521 Adding irlike function: case-insensitive regex 2010-03-28 00:50:51 +00:00
Siebrand Mazeland b274606879 Update code formatting, run stylize.php, whitespace updates 2010-02-13 14:10:36 +00:00
Greg Sabino Mullane ef71cac5a9 Use the new sequence name 2009-11-27 15:36:30 +00:00
Raimond Spekking 3e003e0856 * Move parentheses into tt styled section. From a typographical point of view standard parentheses around tt styled text look ugly. 2009-10-09 16:36:56 +00:00
Jack Phoenix e2a16fe755 AbuseFilter: big commit - coding style & spacing cleanup; also marked SpecialPages' construct() and execute() functions as public and capitalized some SQL keywords 2009-10-07 13:57:06 +00:00
Andrew Garrett 6fc1b1ca79 Don't show navigation links (import, tools) where the user has no rights to view them. Fixes bug 19714. 2009-07-17 16:59:14 +00:00
Andrew Garrett 5c08223f77 Fix bug 18176, hard-coded JS strings needed localisation. 2009-07-17 13:52:40 +00:00
Andrew Garrett fb9d1978cf Change disabled to readonly for textboxes on uneditable filters 2009-07-03 13:54:08 +00:00
Andrew Garrett 3c51c81c93 Add condition limit profiling as well as time profiling to the abuse filter (bug 19256) 2009-07-03 13:46:51 +00:00
Andrew Garrett f176a96fa7 (bug 18659) Allow setting AbuseFilter block duration with $wgAbuseFilterBlockDuration 2009-06-03 15:52:53 +00:00
Andrew Garrett 4a0ce9e562 (bug 18642) Supply filter ID as a parameter to the AbuseFilter warning messages 2009-06-03 15:41:45 +00:00
Andrew Garrett 3b7d6574e6 (bug 18095) Trigger AbuseFilter on file upload. Presently, the only metadata is SHA1, but we'll see what we can do for other stuff on request. 2009-06-03 15:10:44 +00:00
Andrew Garrett 48bfcc35ee Various code quality fixes for AbuseFilter suggested by Tim Starling in a private email, including bugfixes, memory safeguards, performance improvements, removal of redundant code, consolidation of similar functionaality. 2009-05-26 13:08:15 +00:00
Tim Starling da372fdec0 Reverted r49855, r49656, r49401, r49399, r49397. The language converter cannot be used outside the parser at present without generating a large number of bugs, due to global lifetime state variables, inappropriate $wgParser references, etc. Some refactoring needs to be done before it can be used in this way. 2009-05-26 07:46:29 +00:00
Siebrand Mazeland e454269bfc Proper casing for getDBkey() 2009-05-24 08:33:57 +00:00
Andrew Garrett 32aedf1644 (bug 18077) PostgreSQL compatibility issues in AbuseFilter, patch contributed by Brad Jorsch 2009-04-24 03:27:14 +00:00
Andrew Garrett 1a0fc0fea9 Add import/export interface for filters so that filters can be copied across wikis 2009-04-23 04:23:56 +00:00
Aaron Schulz 865d597620 profiling fix 2009-04-17 08:08:35 +00:00
Philip Tzou 28202160b8 Add a new function named 'convert()', allow user to convert a string to specified variant in Abuse Filter. With the support of LanguageConverter which updated on r49397. 2009-04-11 10:59:38 +00:00
Andrew Garrett 7c2a7a2fe0 Support for variable setting with the set_var function, and multiple expressions separated by semicolons (;). In evaluation, the result of the LAST expression will be the return value. 2009-04-01 06:53:18 +00:00
Andrew Garrett 3f62707206 String manipulation functions substr, str_replace and strpos for AbuseFilter 2009-04-01 05:05:23 +00:00
Andrew Garrett 7c3f048fff Usability work, making abuse filter forms readonly (rather than just lacking a submit button and rejecting submissions) for users without permission. 2009-04-01 04:34:21 +00:00
Andrew Garrett 57d1a0b16e Add timestamp variable 2009-04-01 03:59:58 +00:00
Andrew Garrett 186fc67373 Crackdown on filter evaluation by users unable to modify filters. This is a DoS vector which I thought I'd already plugged. 2009-03-31 15:13:26 +00:00
Andrew Garrett 14b850f891 Implementation of global filters, including a major i18n change for abusefilter-log-detailedentry message (rename and split). Needs further testing before deployment 2009-03-30 06:12:12 +00:00
Andrew Garrett 920f04d4fa Fix batch-testing (follow-up to r48855) 2009-03-26 04:41:05 +00:00
Andrew Garrett 3458bf1a7a (bug 18165) Keep the same parser object between filter runs 2009-03-26 04:09:07 +00:00
Andrew Garrett c597c1915f Add contains_any function, for searching a single haystack for multiple needles. Implemented with FSS with a fallback to a for loop, so it should be really fast. 2009-03-26 02:03:32 +00:00
Andrew Garrett cf6f2899f6 Follow-up to r48674. 2009-03-22 10:34:54 +00:00
Andrew Garrett f672c4cee3 Fix batch testing interface, there was old code using the old variable API 2009-03-22 02:46:05 +00:00
Andrew Garrett 4e6754e082 Prevent leaking of filters through diffs 2009-03-22 02:12:51 +00:00
Andrew Garrett 31c6e1d519 Fix bug in testing interface introduced by rsomething 2009-03-19 06:18:41 +00:00
Andrew Garrett 82c958e434 Document contains, ternery operator and conditionals 2009-03-19 05:11:55 +00:00
Andrew Garrett 966b020e6b Document rmspecials, rmwhitespace, ip_in_range 2009-03-19 05:06:39 +00:00
Andrew Garrett f234bcf66d Add basic filter profiling to AbuseFilter -- display on the edit filter page the average time taken to run the filter. Currently sampling at 1/50 2009-03-19 02:40:48 +00:00
Andrew Garrett ce47bca4a8 Load link vars from DB on edit. Includes some tracking of context, so it knows whether to check the DB or the parser. 2009-03-19 02:05:58 +00:00
Andrew Garrett 7b3abbc7c3 Report createaccounts as 'user creating own accounts', rather than as 'IP creating user' 2009-03-18 23:24:10 +00:00
Victor Vasiliev d400dc6763 Fix an XSS bug in AbuseFilter 2009-03-18 19:57:25 +00:00
Andrew Garrett 34cb78e156 Increase threshold for resetting counters. 2009-03-18 04:50:55 +00:00
Andrew Garrett 0ce853e093 Prevent leaking of hidden filters through history interface. 2009-03-17 13:18:33 +00:00
Andrew Garrett 00b468285a Duuuuuh 2009-03-16 23:47:10 +00:00
Andrew Garrett c7f2cb2488 Fix boundary condition for prevention of double-warnings 2009-03-16 23:42:04 +00:00
Andrew Garrett 357c4f030e Workaround for empty $wgTitle in API calls. 2009-03-16 23:02:18 +00:00
Andrew Garrett 0e070fac7f Fix problems with prevention of double warnings 2009-03-13 08:02:05 +00:00
Andrew Garrett 5493b2a690 Add diffs to AbuseFilter. Includes a related pare-down of history, under the assumption that diffs will take up the slack 2009-03-12 05:04:39 +00:00
Andrew Garrett dd0cf2a650 Fix logging where no skin is given 2009-03-11 08:03:25 +00:00
Raimond Spekking 960c9d7463 Use the long time existing pipeList :-) 2009-03-11 07:49:56 +00:00
Andrew Garrett fe5141c412 Add a normal log for filter changes, mostly just a pointer back to the real log. 2009-03-11 07:12:42 +00:00
Andrew Garrett 3a55ecbc85 Link together abusefilter pages with a navigation interface at the top. Add a better intro to the abusefilter home page. 2009-03-11 05:55:06 +00:00
Andrew Garrett 4f2b9a97a4 A whole lotta abusefilter profiling 2009-03-10 22:56:51 +00:00
Andrew Garrett 26752e1d74 Appropriate handling of invalid titles and moves with suppressed redirects. 2009-03-09 13:22:58 +00:00
Siebrand Mazeland 5ebcee6089 * add GENDER support for 'abusefilter-reautoconfirm-done' and 'abusefilter-reautoconfirm-none'
* update message 'abusefilter-reautoconfirm-none'
2009-03-08 18:32:59 +00:00
Andrew Garrett 55b417f517 Add rcount function, same as count except it takes a regex as the needle 2009-03-07 01:26:42 +00:00
Andrew Garrett e60dee6cac Add an interface for extensions to add variables into the variable list (only for ones generated for filtering, for now). Includes an implementation in the TorBlock extension 2009-03-05 02:43:05 +00:00
Andrew Garrett be7dcd9b3b (bug 17674) Add minor_edit variable to AbuseFilter 2009-03-04 02:04:48 +00:00
Andrew Garrett 03e12503a3 (bug 17664) Handle section-editing correctly by switching from EditFilter to EditFilterMerged.
Also, fix a weird bug where the Abuse Filter was diffing the parsed text, not the wikitext
2009-03-04 01:56:21 +00:00
Andrew Garrett f94f42b506 Store Abuse Filter variable dumps to external storage instead of leaving in afl_var_dump. afl_var_dump needs to be left as a BLOB for the moment for backwards-compatibility. 2009-02-27 03:06:19 +00:00
Andrew Garrett 787672cdf7 Don't pointlessly add lots of whitespace to the end of rules. One newline is enough 2009-02-26 12:22:26 +00:00
Andrew Garrett 92698e95ba Improve AbuseFilter performance by implementing lazy initialisation of computed variables.
This has been done by replacing simple associative arrays with an AbuseFilterVariableHolder, which recognises helper classes called AFComputedVariables.
Computation may occur during the abuse filter analysis, or later when testing and reviewing filters.
2009-02-26 12:15:14 +00:00
Andrew Garrett 98a94ff5d9 Fix Abuse Filter after-the-fact var generation -- was using request IP address in place of IPs for anonymous changes 2009-02-25 04:31:53 +00:00
Andrew Garrett 20c9542fe3 Another silly reautoconfirm bug -- nothing was being returned. 2009-02-19 00:18:31 +00:00
Andrew Garrett 1c87a7ba69 Fix some silly bugs in reautoconfirmation 2009-02-18 19:34:36 +00:00
Andrew Garrett d3d4333f42 Fix silly fatal 2009-02-13 18:30:34 +00:00
Andrew Garrett 64154e283d Correctly deal with emergency disabling, hit counts, etc for filters with 'throttle' and 'warn' actions. 2009-02-13 01:40:57 +00:00
Andrew Garrett 35e61feeb6 Abuse Filter Parser updates
* Deprecate parseTokens in favour of a parse-as-you-go approach, faster and uses less memory.
* Display variables in lower_case so they aren't SHOUTING_AT_PEOPLE.
* Tell people if they try to use variables that don't exist, rather than silently returning NULL.
2009-02-11 20:00:33 +00:00
Tim Starling c8b0007232 * Break long lines. If I'm going to review this code, I need to be able to read it.
* Write array literals with one item per line. This makes diffs which add or remove items far easier to interpret, and makes merging such changes feasible. And it looks nicer too.
* Use line breaks to show the logical structure of your code. This enhances readability. Bring similar elements in a list into alignment, in order to reveal the differences between those elements at a glance.
* Removed a fun game of spot-the-difference in AbuseFilterHistoryPager::getQueryInfo(). If I want fun games I'll play UFO:AI.
* Moved some oddly placed assignments (in expressions) to their own statements: such assignments reduce readbility.
2009-02-07 09:34:11 +00:00
Andrew Garrett 53edcafc69 Reduce exception on encountering an unrecognised action to a debug log message. 2009-02-07 02:26:56 +00:00
Andrew Garrett bcf5381eec Fix up throttling -- was allowing one extra action. 2009-02-03 23:44:47 +00:00