Commit graph

194 commits

Author SHA1 Message Date
Reedy 6204b76512 Fix Call to undefined method TableDiffFormatterFullContext::_start_diff()
Bug: 57268
Change-Id: I3bf5f6690530a89f25b1716406a92524d07c4c2b
2013-11-19 20:09:32 +00:00
Siebrand Mazeland b384fe8d8f Declare class properties, update docs
Based on static code analysis.

Change-Id: Ibafe33b6327ab72429ba961079af40039fb41cbf
2013-11-06 16:12:37 +00:00
Siebrand Mazeland 2bb441ee9c Declare visibility on class properties
Also compress some variable documentation.

Change-Id: I47d31e18df18492373aa407ea19f1a81b2cf5d57
2013-11-06 16:11:09 +00:00
Siebrand Mazeland ddc930e897 Ensure variables are defined
Change-Id: Iab1d36b0162c1d7a91cdd80ac36bbf338e7df61d
2013-11-06 17:09:24 +01:00
jenkins-bot 14871447ee Merge "Adding some comments to explain what various classes are for." 2013-11-05 13:26:15 +00:00
kaldari 307b078ada Only allow throttling if object caching is enabled...
...otherwise it doesn't work.

This change add 2 checks for object caching, one for the filter
configuration interface, and one for the actual throttle checking.

Bug: 50894
Change-Id: I89ebcc6ff7d91d3a9ad8e744c0c4ff3e33e3b673
2013-10-31 14:59:26 -07:00
kaldari b165827b67 Adding some comments to explain what various classes are for.
Change-Id: Ic44342035bc277dfd75c1da06a3a1205e8c659a4
2013-10-24 15:11:08 -07:00
jenkins-bot 1c439d0002 Merge "Add missing parameters to message call" 2013-10-21 17:19:16 +00:00
Simon Walker 3612f45b2b Remove trailing whitespace
Change-Id: I1d9c4e64d09eeb9470d85476e030a1590495fa52
2013-10-07 18:08:11 +01:00
Simon Walker 938d101711 Add links to abusefilter-edit-done
This adds a link to the diff of the edited filter, and a link to the filter
itself.

Bug: 52590
Change-Id: If741756ef398a61ae0fcd809eaee5a040ac8ca3d
2013-10-07 13:17:07 +01:00
Marius Hoch 5ed5230a49 Refactor AbuseFilterView::canEdit* functions
Don't use global state in here, centralize
the logic for global filters and avoid static
functions.

This also makes the UI for global filters nicer
in case the user can't edit them (as all fields
are disabled then).

Change-Id: Ica4e77536d315d8ef39a45666c6b8834315bee77
2013-08-26 19:57:00 +00:00
grunny 9b1433ead3 Add missing parameters to message call
Add missing parameters for abusefilter-edit-lastmod-text message on the
global filter list view. Two of the missing parameters are used by the
German translation of the message.

Bug: 51780
Change-Id: Iec5cf4f37f3d5f512c6c57de234e0f7b3a3ba502
2013-08-15 23:49:08 +10:00
Siebrand Mazeland a178585558 Remove duplicate case expression
Code was unreachable.

Change-Id: I83b1c2e288cb3fab50155f7baf7f608bed6274da
2013-08-05 12:46:53 +02:00
jenkins-bot 2e8fc6f751 Merge "Prevent custom warning messages for global rules" 2013-07-02 21:41:48 +00:00
Marius Hoch 013889c5ac Prevent custom warning messages for global rules
This prevents an abuse filter admin from setting a custom warning
message (which are references to a non-translated, local wiki page),
for global filters (which can be on any wiki in any language).

bug: 45164
Change-Id: If61716053b75f45e4b70f78d3809ddd02ac6d83e
2013-07-02 23:20:06 +02:00
MatmaRex 6756f6f936 Pass context when contructing DifferenceEngines
Change-Id: I926c910bf983ae023bfc0c20a9262a1bde452a17
2013-06-29 23:52:08 +00:00
MatmaRex 3d4d705b06 AbuseFilterViewDiff: Make diffs use standard styling (and more)
They still used old 1.18-style diffs, with styles copied from core.

Also:
* Remove the distinction between "simple" and "multiline" diff chunk,
  enabling consistent styling
* Always show word-level diff, even in previously "simple" chunks
* Ensure the full context is always shown. This was clearly intended
  (showing straight side-by-side comparison if there were no changes
  and in "simple" chunks, diff otherwise; showing chunks with no
  changes), but the default context is only 2 lines.
* Remove the distinction between 'wikitext' and 'text' diffs (all are
  treated like 'text' was); it's impossible to show parsed code with
  word-level diff, and it was only enabled for "simple" chunks, all of
  which are intended to be one-line strings and are shown unparsed
  elsewhere (e.g. filter description on the list on Special:AbuseFilter)

Bug: 36478
Change-Id: Ie24ad5ac5a9a2bc9b8f0fc0c4a03d5dfe7a6a83f
2013-06-29 23:43:45 +00:00
Marius Hoch 8957c003ba Revert "Change AbuseFilter to use UserCache instead of user_text fields"
This reverts commit aaa256aa94.

Bug: 49918
Change-Id: I597cbc03e2ecc45cfcca632232d5bbb1ef7be9d8
2013-06-27 01:01:15 +02:00
Marius Hoch 7705e90506 Hide external changes in Special:AbuseFilter/test
Like on /examine

Change-Id: I760ad45f9858ccf088e5a8a12ddb57770a4a4ff8
2013-05-24 22:24:06 +02:00
Marius Hoch 841c7e0c9e Hide external changes in Special:AbuseFilter/examine
Doesn't make sense to have them in there.

Change-Id: I699641a017f03534cb82302a83025f0194a198fe
2013-05-24 16:34:22 +02:00
jenkins-bot 4dca6c6e14 Merge "Fix the subtitle for the AbuseFilter history view" 2013-05-23 14:02:15 +00:00
Marius Hoch 6ac46771c6 Fix the subtitle for the AbuseFilter history view
The html was wrongly escaped. Also append it to the
existing one to leave the navigation in place.

See the subtitle on:
https://en.wikipedia.org/wiki/Special:AbuseFilter/history/?user=Foo

Change-Id: I5725fe15eda1a48fd313c6394800e8b92c450d9d
2013-05-23 13:04:09 +00:00
Aaron Schulz 05b38eb613 Merge "Change AbuseFilter to use UserCache instead of user_text fields" 2013-04-09 22:00:51 +00:00
Alex Monk aaa256aa94 Change AbuseFilter to use UserCache instead of user_text fields
Change-Id: I51210ff91366a3a1610d34ca20e8966aaded89a0
2013-03-27 15:59:34 +00:00
shirayuki b460fa790f Adding trailing dot + comment for grep (24 messages)
Change-Id: I7b532028a2bdbed11f0dfe6cdf4eb4514671294c
2013-03-07 23:03:59 +09:00
Marius Hoch 3a3c738f50 Escape AbuseFilter description properly (disallow wikitext)
Right now the public description of AbuseFilters can contain
wikitext which will be parsed.

With this change the public description will be escaped
everywhere to prevent the parsing of eg. templates on
Special:AbuseFilter/history.

Change-Id: I777cac5fc195819ed296f791d0b8cc3ed2ae9eea
2013-02-05 00:08:20 +01:00
Marius Hoch c4e78e9713 (bug 18174) Added Older and Newer change link to Abusefilter diff
On top of that I changed /history to no longer show the
changes link if it's the first revision of the filter.

As I was on it I fixed the diff selection for diffs like
history/1/diff/2/next where change number 2 was compared
to the last change of the filter instead of the next one.
This probably went unnoticed because the /next action isn't
linked anywhere within the software itself.

Change-Id: Ic28bb696a4dbbb75e0bfcae1843ccefab1a9508a
2013-01-18 10:42:22 +01:00
CSteipp b8b799630b Merge "Properly integrate $wgAbuseFilterValidGroups" 2013-01-07 23:01:48 +00: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
Hoo man 25232efb24 Merge "Adding a Link back to Abuse filter management page Added the navigation bar Set page title to 'Editing Abuse filter'" 2013-01-06 20:59:59 +00:00
Adithya Parthasarathy 2128a52a9c Adding a Link back to Abuse filter management page
Added the navigation bar
Set page title to 'Editing Abuse filter'

Change-Id: Ic11846d43587c2241df0635aabf3b9b3fae4056d
2013-01-07 01:55:19 +05:30
Marius Hoch d307970e1e Fixed a PHP notice in Views/AbuseFilterViewEdit.php
Change-Id: I39a6a4b3063dd4c5b07b014940170442c2bbdbe7
2012-12-30 05:02:04 +01:00
Hoo man f10b8eaab5 Merge "Add Permission for Global-Rule Editing" 2012-12-28 01:29:39 +00:00
csteipp cc000576d7 Add Permission for Global-Rule Editing
Add a permission 'abusefilter-modify-global' which an administrator must
have to set global rules in the central database.

By default, this right is not associated with any group.

Change-Id: Ied92f7ffd90cb2d8eeb8f3f26b941edbb22b10d6
2012-12-28 02:27:08 +01:00
Hoo man 7950267f98 Merge "Run filter number through formatNum()" 2012-11-02 21:14:33 +00:00
Hoo man d2568a7d43 Merge "fix php notices" 2012-11-02 19:57:52 +00:00
Aaron Schulz 3fde2a8c75 Merge "Don't revert global log actions" 2012-10-26 22:39:06 +00:00
raymond 3f1b73e5f4 Run filter number through formatNum()
Change-Id: If95bbae4af3d4c5a35ee02f1adadc4040ef36009
2012-10-26 20:27:08 +02: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
Amir E. Aharoni d146521d99 (bug 18277) Add GENDER to abusefilter-diff-version
Passed the username parameter to all uses of abusefilter-diff-version.
Added documentation and dummy GENDER to the English message.

Change-Id: Ie4df30cd6bdc8a1451fe42478bdfba5acb05c8d7
2012-10-24 15:00:48 +02:00
Siebrand c94c0e2687 Merge "Resolved two array_map wfMsg FIXMEs" 2012-10-17 22:37:51 +00:00
Krenair 060a1d2cf8 Fix some errors on the main AbuseFilter page
I've been getting some errors on Special:AbuseFilter:
Warning: array_merge(): Argument #2 is not an array in /my/path/to/includes/Sanitizer.php on line 840
Warning: Invalid argument supplied for foreach() in /my/path/to/includes/Linker.php on line 366

This is the fix I came up with for them. I don't know how the previous code ever worked...

Change-Id: Ia6b159f184786d10fb696d267e65ce0530e8c64f
2012-10-14 22:46:55 +01:00
Marius Hoch 636018137b Resolved two array_map wfMsg FIXMEs
Resolved two wfMsg related FIXMEs introduced in
I02ba4ce31b6aca5b7324114093f8ece143abc295 using
foreach loops. (UNTESTED)

Change-Id: I84e9b875b670f9eaa9c8a70e85c3b1b637113033
2012-10-10 19:59:14 +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
csteipp 736095adaa Don't revert global log actions
Prevent attempting to revert a global rule's actions, when the action
happened on another wiki.

This is probably a temporary fix. Eventually, we may want to support
having a central administrator revert actions from global rules on
the local wikis.

Change-Id: Idd29596ddc21c37d81528a8ae6ed14367c373c5f
2012-09-12 09:49:13 -07:00
grunny 13bdc746ed Add missing message from the edit view for global filters
This message is used on the edit view when global filters are enabled to specify
whether or not a filter is global.

Patch Set 2: Add comments on where the message is used along with other messages
that can be formed by the concatenated string so they are easier to find

Change-Id: I5d1e99fa1dcaea8ed298affbd6388042f58686ee
2012-09-04 19:13:02 +10: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
Liangent 1b7994b3bd Use a new message for subtitle of edit view when creating filter
Change-Id: Ie956ce2954e8f2507191677561fe68b548eddba5
2012-07-02 01:43:47 +08:00