Commit graph

5346 commits

Author SHA1 Message Date
Daimona Eaytoy b3e0529d55 Log deprecated vars in the cached phase in the new parser
For the new parser, xhgui shows that AbuseFilterParser::getVarValue is
taking up a lot of time; in turn, most of the time spent inside
getVarValue is used to log the use of deprecated variables. Hence, given
that:
 - We should keep the new parser performant
 - There are tons of deprecated variables out there and they likely
 won't be replaced
 - Having gazillions of debugLog entries doesn't help

log them only in the cached phase.

Bug: T234427
Change-Id: I2bfc692c829c3cbe889e5076f5205e2c99097087
2019-12-16 13:54:58 +01:00
Daimona Eaytoy a7dd20b040 Don't use mFilter in ViewTestBatch
In other View* classes, AbuseFilterView::mFilter contains the ID of a
filter, e.g. the filter being edited in ViewEdit. In ViewTestBatch,
however, it is a string containing some filter text. Hence, use a new
private property instead (without the legacy "m" prefix).

Change-Id: Ib22ce238aff4ca5ed57ba725ee9bff7f8c3d153b
2019-12-16 12:17:49 +01:00
Daimona Eaytoy b814c0827a i18n: Rename msg key for abusefilter-view-oldwarning
Thinking about it again, all messages on ViewEdit start with
abusefilter-edit. Also add a reference to the other message to
facilitate translations.

Follow-up: I3717d06d4a757684fe6622961391ae06b5bd3c38
Bug: T235590
Change-Id: I4cbaa2e92d22296f55a4b5ef0c633fe959fe9ea3
2019-12-16 10:56:30 +00:00
DannyS712 12efe4a0ad ApiAbuseLogPrivateDetails: private-details should be privatedetails
Bug: T240812
Change-Id: I263e3a57a48ab6a58e4c7f2181a914d9800a2fc5
2019-12-16 03:25:15 +00:00
jenkins-bot 62f7b574f1 Merge "Add a base class for parser transition" 2019-12-15 19:09:08 +00:00
libraryupgrader b47b6cea38 build: Updating grunt-banana-checker to 0.8.1
Additional changes:
* Added .eslintcache to .gitignore.

Change-Id: I51f571f920fde95575497cc7b98ef3b9bbc37d2f
2019-12-15 13:49:12 +00:00
Daimona Eaytoy f382304aae Add a base class for parser transition
Change-Id: I31282b8632c332b6d46a6bb4a42f57ac0d005b5f
2019-12-15 13:29:56 +00:00
Translation updater bot 57657ff317 Localisation updates from https://translatewiki.net.
Change-Id: I3771c60494d46074b661c77ecd256be6275647c9
2019-12-13 09:23:58 +01:00
Translation updater bot 42a76b4695 Localisation updates from https://translatewiki.net.
Change-Id: Iea311665c53fbe36858a11aef4ecf6efab1c4a00
2019-12-12 09:54:26 +01:00
Daimona Eaytoy c432f058fd Restore the ability to filter content model changes
Follows-up I3fb7b36ab38ca1544889a4c233b8ffdfc6c80936

Bug: T240485
Change-Id: I2e8337e6f505932a18a5bb5a0d97b9d6bc3f42c8
2019-12-11 19:42:45 +01:00
James D. Forrester cff9889549 Move test-only classes to new TestAutoloadClasses declaration
Bug: T196090
Depends-On: I88cf69663362fd599c20649b1df641907a02678d
Change-Id: I5e3ef040628c4ff629a8aabc56a3b8ba259b7e78
2019-12-10 12:18:17 -08:00
Daimona Eaytoy 20c6810039 Use explicit variarg for VariableHolder functions
This is easier to read and to document, and it also allows typehints.

Change-Id: Ibd6642aa26e25a785faadf5139e64ea884ff4de2
2019-12-10 19:28:07 +00:00
Daimona Eaytoy 6be070e5a2 Strengthen the check for null edits
Even if the Content objects are different, the normalized text contents
may be identical.
Also, stop misattributing null edits by adding the last revision of the
page as afl_rev_id.

Bug: T240115
Change-Id: I3fb7b36ab38ca1544889a4c233b8ffdfc6c80936
2019-12-10 17:03:49 +01:00
Translation updater bot f443eb8533 Localisation updates from https://translatewiki.net.
Change-Id: I03a505953b4ab57df3fedb4746c6b13ad9a0141c
2019-12-09 09:31:35 +01:00
Translation updater bot b720f71a14 Localisation updates from https://translatewiki.net.
Change-Id: If1f8b8775164d44f1ae28f53cb12460cde3ebbd7
2019-12-06 09:26:54 +01:00
Translation updater bot d6fd5def21 Localisation updates from https://translatewiki.net.
Change-Id: Ic5aee771a916f803e82288117f864e82850521c2
2019-12-05 09:43:07 +01:00
Daimona Eaytoy d5ab147dcf Fix AbuseFilterCachingParser violating return type constraint
This is identical to I8a3c31e7385283d95b4712d457784016239a0b3b, except
for the array append case.

Bug: T236870
Change-Id: Iac033ba467232f6ff110d575920e968759ce0e15
2019-12-04 18:27:46 +00:00
jenkins-bot 357dcdce5c Merge "SECURITY: Unbreak blocks shorter than one hour" 2019-12-04 18:17:58 +00:00
Daimona Eaytoy 759cb38bf5 SECURITY: Unbreak blocks shorter than one hour
Bug: T238768
Change-Id: I8820a6e2953255f409ff8ddc2b41dcef2f338e37
2019-12-04 18:46:40 +01:00
Translation updater bot cb6f3500b1 Localisation updates from https://translatewiki.net.
Change-Id: I8d65208236693296257ef59619159d51dca81193
2019-12-04 09:20:39 +01:00
jenkins-bot 6959bc3a89 Merge "Really throw for too many params" 2019-12-03 19:18:32 +00:00
jenkins-bot 156b9b7f26 Merge "Forbid assignments where the LHS is a built-in identifier" 2019-12-03 19:18:05 +00:00
Daimona Eaytoy 2755685b5c Update fixOldLogEntries
Make it also delete duplicated rows created by addMissingLoggingEntries.

Bug: T228655
Bug: T208931
Change-Id: I0e294d75e06592440773f224ef6aef172b8b9eba
2019-12-03 17:57:33 +00:00
Daimona Eaytoy 302c967ce7 Fix addMissingLogEntriesScript
This script was plagued by several problems:
 - it used SUBSTRING_INDEX, thus breaking support for Postgres and
 SQLite
 - it didn't recognize non-legacy rows, thus creating duplicates
 - it didn't extend LoggedUpdateMaintenance, but we only want it to be
 executed once
 - it didn't have a dry-run option

And most importantly: it inserted new rows using '\n' as separator,
instead of "\n" (note single quotes), thus creating broken entries.

Bug: T228655
Bug: T208931
Change-Id: I3a7b0fe32f1516ba21fa0ef380a9f54062e9c680
2019-12-03 17:45:00 +00:00
Translation updater bot 019895d368 Localisation updates from https://translatewiki.net.
Change-Id: I3e5d5a5fc8fd75fe3e24b5185ace2c0ea927033d
2019-12-02 09:17:25 +01:00
DannyS712 e42a40bc06 ApiQueryAbuseFilters: Return abfstartid as an integer
Bug: T239528
Change-Id: Iee4d885c9b7fe1ee255ba9c0ac9e7e8f99938ef8
2019-12-01 14:21:31 +00:00
Daimona Eaytoy 07572da2fe Really throw for too many params
Bug: T230803
Change-Id: I4e68bb7220f1151bb32b2be859f6cffc55888a30
2019-11-30 10:57:16 +00:00
Translation updater bot 7b6e2bdd23 Localisation updates from https://translatewiki.net.
Change-Id: Iaf220577587b357da6f89d0c85edef7e7ca55684
2019-11-29 09:23:41 +01:00
Daimona Eaytoy 2ddd79fd98 Forbid assignments where the LHS is a built-in identifier
And not just a built-in variable.

Bug: T237130
Bug: T237216
Change-Id: Ie1d86dc324993efcb863be23697732e6aa1dac10
2019-11-28 14:40:38 +00:00
Translation updater bot 137eb65cc2 Localisation updates from https://translatewiki.net.
Change-Id: I67312f485080df1cd1f5c604904419882aafdd68
2019-11-27 09:34:36 +01:00
jenkins-bot 1608ce9fc2 Merge "Raise Equivset composer dependency to 1.4+" 2019-11-26 17:43:15 +00:00
Translation updater bot 7ee59ea443 Localisation updates from https://translatewiki.net.
Change-Id: I12c1da1f12ac380ba9635b3deff7b576cf610b61
2019-11-26 09:14:55 +01:00
Translation updater bot 3054c08a80 Localisation updates from https://translatewiki.net.
Change-Id: Icb04f643575c31c3c3b0e6a68371d8c0408a62cf
2019-11-25 09:08:16 +01:00
Daimona Eaytoy fb4e98d0ec Clarify error message for non-literals passed to set/set_var
Bug: T238713
Change-Id: Iacf880e496f701dde38f1d216c3fce000973354a
2019-11-24 18:05:49 +01:00
Daimona Eaytoy a2354724c9 Raise Equivset composer dependency to 1.4+
Just released, see
https://gerrit.wikimedia.org/g/mediawiki/libs/Equivset/+/refs/tags/1.4.0.

Bug: T238995
Change-Id: I41cfb3b9bbfd145baea796e79078d19ac00ef523
2019-11-23 20:34:25 +00:00
Daimona Eaytoy 0672a8eb8a Ensure that a min/max arg count is available for all built-in functions
This is especially useful for old patches, created before the
introduction of FUNC_ARG_COUNT, where a rebase may break the parser.

Change-Id: Ib142438626a7305f102dc3e4cc9cb07ad33902b8
2019-11-22 17:59:00 +01:00
Daimona Eaytoy b44c9da561 Use af_deleted as secondary sorting for af_enabled
Otherwise deleted and disabled filters would be mixed. Needs dependency
in core, otherwise we'd use af_deleted as secondary sort for every other
sortable field.

Bug: T191694
Depends-On: I0e695f96f18c7a9229753b1225dd473feb936a31
Change-Id: I979849e66bdcc158b7a3d0793ee3196e20db37b6
2019-11-22 16:23:46 +00:00
jenkins-bot a8c50150d6 Merge "Convert static arrays to constants" 2019-11-22 13:39:39 +00:00
jenkins-bot 2d2e524dca Merge "Tokenizer: don't strip backslashes from \x" 2019-11-22 13:36:49 +00:00
Translation updater bot 8bed72cfd6 Localisation updates from https://translatewiki.net.
Change-Id: Id9cb9d30d31efd6fd30ecf9d25c8a57e0accf94f
2019-11-22 09:12:14 +01:00
jenkins-bot 9a7027fe64 Merge "SECURITY: Require view-private or modify for the evalexpression API" 2019-11-21 15:54:46 +00:00
Daimona Eaytoy cee8e14cf1 SECURITY: Require view-private or modify for the evalexpression API
This is consistent with the "anti-DoS" measures on other API modules.
Although this may not be a serious DoS vector, it makes sense to
restrict this module. Moreover, it's also consistent with
Special:AbuseFilter/tools (which is the corresponding web interface),
which requires the same user rights.

Bug: T238451
Change-Id: Id09fd57195d71884674ac0470f137ca30c56e13c
2019-11-21 16:33:04 +01:00
Translation updater bot 956eca36cb Localisation updates from https://translatewiki.net.
Change-Id: Ie63e3492a0790a9233dc29f07474e31c4e880448
2019-11-20 09:35:53 +01:00
jenkins-bot 89170711a8 Merge "Set the utf-8 flag for var dumps in the text table" 2019-11-19 15:28:52 +00:00
Translation updater bot adbeec5176 Localisation updates from https://translatewiki.net.
Change-Id: I80d0b3824b80819062f927145aa472608a17a1ca
2019-11-19 09:32:01 +01:00
Translation updater bot 29bd469e02 Localisation updates from https://translatewiki.net.
Change-Id: I80a2dbf283d50c4d3c63f59fa707449fb03d0161
2019-11-18 09:19:21 +01:00
Daimona Eaytoy b3e58067ac Set the utf-8 flag for var dumps in the text table
This is not retroactive; that will be handled as part of T213006.

Bug: T34478
Change-Id: I2c532da71719a9ace1279bbf67d6e6e30e9a986c
2019-11-16 16:00:45 +00:00
Daimona Eaytoy c03f0a3b08 Convert static arrays to constants
Beloved PHP7!

Change-Id: Id5170662f7c5ceacfc0ac8d90787f2c92fd93464
2019-11-16 16:32:36 +01:00
Daimona Eaytoy c73381b6db Tokenizer: don't strip backslashes from \x
Bug: T238475
Change-Id: I8c2ea6ad369946df93440eece60d456dc1a3fd7a
2019-11-16 16:21:39 +01:00
Translation updater bot a0b349d4c3 Localisation updates from https://translatewiki.net.
Change-Id: Ib8d00edacae2b6bdb654ee247711c4f198bd72bb
2019-11-15 09:18:35 +01:00