Commit graph

217 commits

Author SHA1 Message Date
Aaron Schulz dca2451597 Conversion to using startAtomic/endAtomic
This avoids breaking any outer transactions

Change-Id: Idcafec3b4c69948dbbb05677aaf7f65ed6c21574
2015-10-07 22:54:58 -07:00
Legoktm fe8cdc35ca Revert "Add "Last hit" timestamp column to Special:AbuseFilter list view"
This reverts commit 77d161f65c.

Bug: T106798
Change-Id: I265ae108aecbacfcce808ad21e18be4e0eef750e
2015-07-24 10:11:57 +00:00
glaisher 77d161f65c Add "Last hit" timestamp column to Special:AbuseFilter list view
It'll show the timestamp at which the filter was last triggered.
If there is no hit or if the user does not have the proper permissions,
it'll be blank.

Bug: T93564
Change-Id: I435af5caf457c548fa0737ed226d7f8640ff25d8
2015-07-17 10:40:45 +00:00
Aaron Schulz 9ffa400322 Conversion to using getMainStashInstance()
Bug: T97620
Change-Id: I7fc2c0a42bf295d71b9e0721ab4261290334cdec
2015-06-24 20:18:22 +00:00
Aaron Schulz afb78deb84 Removed filter profiling using $wgMemc
* This is very slow as there can easily be hundreds of filters,
  each doing 6 memcached queries. Xenon flamegraphs show a lot
  of time spent in this method, slowing down editing.

Change-Id: I31e4502bbd45cc284db3cd89eb34ad365c59905b
2015-05-19 08:14:33 -07:00
Aaron Schulz 60d1eebb6b Conversion to using WAN cache
* Also removed some code duplication
* Use getConnectionRef in checkAllFilters so that the
  DB connection can be reused

Bug: T93141
Change-Id: I17c5a976b6c45029cde4ed34ad82d69e365ae8c5
2015-05-12 22:55:05 -07:00
Aaron Schulz d0dc183314 Fixed change tag list purging
* Use ChangeTags::purgeTagCacheAll().
* The prior code did not change that actual tag table and
  in any case did nothing since 878523f6225 due to a key
  rename. This covers the two keys using two AF hooks.

Bug: T91815
Change-Id: I227414cde2e95d4533fdf708579113cd3bf2856a
2015-05-12 11:23:17 -07:00
glaisher a4484168e1 Add help link to mw:Extension:AbuseFilter/Rules from Edit view
Bug: T94328
Change-Id: Ic7f39fd6b407942d4691abc9b4f2ff2841ce21f6
2015-03-29 17:38:53 +05:00
se4598 6d316690a9 add filter option for local rules only on central wiki
only affects filter list on central wiki. You can now select to see
local only, global ones or both filters.

Bug: T78495
Change-Id: Idb37aa4f5c3515e0295b74a43176edd2c62508f8
2015-02-17 09:00:44 +01:00
se4598 b6ff5663ab add missing title-param to abusefilter-log form
without it, you get redirected to the main page (index.php) when
$wgUsePathInfo = false; as no title-parameter is given.

also don't rely on __tostring.

Change-Id: I6b97d61c58b196c95836036219201cff8e2e0657
2015-01-04 07:49:44 +00:00
glaisher 6129d2f500 Add a link to filter id in Special:AbuseFilter/history
Currently, there is no link to the current version of the filter
from the history (unless one clicks on the last timestamp link of
that filter) and that is sub-optimal.

Change-Id: Ibc7fcfab386e687d052878602fa810c5a3590d6c
2014-11-17 22:50:43 +05:00
se4598 30fbaf5012 code cleanup: $warnMsg is always set before
removes wrong typed never used alternative value

Change-Id: Ica747fd0904605f5415d763c8f8e00ac55a79053
2014-10-04 17:16:21 +02:00
helderwiki 3b284d8ef2 Expose variables to JavaScript when viewing details or examining a log
When examining AbuseFilter logs using user scripts, it is convenient to have
access to the variables shown in the table, without having to interact with
the page to get the content of the table cells.

This change introduces the variable wgAbuseFilterVariables on these pages:
* Special:AbuseFilter/examine
* Special:AbuseLog/<logId>

Change-Id: I2cebf141e6c1d26e62ed7e6ba0b5c327694e2ef8
2014-08-07 10:23:54 +00:00
huji edabcbc6aa Separate parameters for the filter ID and localized filter name in AbuseFilter
Bug: 67254
Change-Id: I0343971b8be6984820ddf861a76132c9dd064829
2014-06-28 15:23:43 -04:00
Matthias Mullie 2c449c3acc (bug 65805) Fix notice when creating new filter
Notice: Undefined index: af_throttled in
extensions/AbuseFilter/Views/AbuseFilterViewEdit.php on line 148

This assumes af_throttled to exist in $newRow, which comes
from AbuseFilterViewEdit::loadRequest, which in turn comes
from AbuseFilterViewEdit::loadFilterData, where no
af_throttled property is added to the newly created object.

Bug: 65805
Change-Id: I45ad0ea2cea242711b6109e67b99b71242ff57f6
2014-05-27 15:26:17 +02:00
Kunal Mehta 4deb2cc1be Use FormatJson instead of json_* functions
Change-Id: Ic4eccb13429d4081153b5deb550ac33bf2bd687d
2014-02-27 08:38:07 -08:00
addshore 28ad8fa659 Remove random space in AbuseFilterViewTestBatch
Change-Id: I2c95e09d7e34ed1d517114324b2ad988ad659dfb
2014-01-25 14:04:18 +01:00
tonythomas01 068c3c54c3 Increased the number of rows in AbuseFilter's Filter testing textarea
Changed the textarea size in AbuseFilter Notes text area
from 5 to 15 to match with the new Conditions text box.

Bug: 55365
Change-Id: I1da26166f28f31b2a18c1dca3709efc0728d45d6
2014-01-25 00:42:05 +05:30
Chad Horohoe f38a00336d Don't even mention $wgTitle in comments
Change-Id: I28c8c4cb31e7beafcc3bca2620c3e65d8853ad51
2014-01-22 20:47:06 -08:00
jenkins-bot 90b18774fc Merge "Prevent fatal error in Special:AbuseFilter/test" 2014-01-15 00:18:49 +00:00
tonythomas01 c5dea20d99 Used [[MediaWiki:Parentheses]] instead of hardcoded parentheses
Corrected $s .= " ($examineLink)";
Corrected Wrong code
Added the ' ' before parantheses
Corrected spell error

Bug: 50796
Change-Id: I50a0b93a86101e6556045d91d03a4784deacaaea
2014-01-12 19:59:41 +05:30
Jackmcbarn 4255e3810b Prevent fatal error in Special:AbuseFilter/test
When an invalid page name is entered in Special:AbuseFilter/test, display
a sane error message rather than throwing a PHP fatal error.

Bug: 55411
Change-Id: I5ec005180c9009f6d14244f3b03221e525cfaed3
2014-01-04 15:28:37 -05:00
Kunal Mehta e7f8acf709 Replace usage of SpecialPage::getTitle with getPageTitle
Was deprecated in 1.23, see Icdcf5d5295ef5e7f08b1d403e0c123f78738fd40

Change-Id: I67701856297927b94aa443a78376bae7d7860def
2013-12-26 22:36:34 -08:00
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