Commit graph

4920 commits

Author SHA1 Message Date
jenkins-bot 48ac8c492b Merge "Temporarily catch another BadMethodCallException" 2019-05-19 17:13:10 +00:00
jenkins-bot e66d30d37c Merge "Don't send empty array to Database::makeList" 2019-05-18 12:27:50 +00:00
jenkins-bot 75e5c907fc Merge "Remove problematic array type hint from hook handler" 2019-05-18 09:01:48 +00:00
Daimona Eaytoy 291c35cea0 Don't send empty array to Database::makeList
Check that the provided param is not empty, as otherwise
Database::makeList will throw and the exception will bubble up to the
user.

Bug: T222531
Change-Id: Icf5db25037a0d0a7b4076f21e7f1c9a6ee1d5a87
2019-05-18 10:55:26 +02:00
Thiemo Kreuz 1c5accd90a Remove problematic array type hint from hook handler
It's possible this parameter is null, as demonstrated in Id2caa44.

Change-Id: I69bf0d70552fb049aa1c93bb12bcb5cc9e457c53
2019-05-18 08:50:22 +02:00
jenkins-bot 6250eaea39 Merge "Add missing type hint to SpecialPage::execute()" 2019-05-16 15:19:22 +00:00
Thiemo Kreuz aba489a1f4 Add missing type hint to SpecialPage::execute()
[Also make use of the list() feature in one case I forgot before in
If2b6c95.]
 -> Changed to use direct array access by Daimona per inline comment.

Change-Id: I708dff30b6e00ccab3257b2e6fa5995eb9e30e0f
2019-05-16 14:31:54 +00:00
Daimona Eaytoy 44632f21a4 Temporarily catch another BadMethodCallException
This is the same as line 224, and I forgot to include this code path in
the same patch.

Bug: T187153
Change-Id: I28074680760a7070eb423b5eada1e35f829ed10a
2019-05-16 15:49:17 +02:00
jenkins-bot 99e821b125 Merge "Upgrade PHPCS and phan" 2019-05-15 19:42:42 +00:00
Daimona Eaytoy 311f68f6e8 Upgrade PHPCS and phan
Change-Id: Ibfb737e4552133d1ddd388e7410c6e1bc3a72e12
2019-05-15 19:06:04 +02:00
jenkins-bot 915bea466e Merge "Make use of PHP's list() feature where possible" 2019-05-15 15:06:20 +00:00
jenkins-bot c52850aae7 Merge "Add missing limits to explode() calls" 2019-05-15 15:06:18 +00:00
Thiemo Kreuz c6f20a64dd Add missing limits to explode() calls
This is fixing potential bugs where invalid strings with more than one
comma have silently been accepted.

Change-Id: Ib1e7d0c99973f243ef6faad6389bab688187c1cf
2019-05-15 16:14:12 +02:00
Thiemo Kreuz 3dece9ef8c Make use of PHP's list() feature where possible
Change-Id: If2b6c95a319800dd4944ecc0d7a8d3a819c846c1
2019-05-15 16:12:51 +02:00
Thiemo Kreuz fa3ce90851 Remove comments literally repeating what the code says
I find it obvious that a file called "AbuseFilterTokenizerTest" is a
"test for the AbuseFilterTokenizer class". A comment that is just
repeating this information is typicalls not helpful, but distracting
and a potential source of mistakes, e.g. when stuff is copy-pasted,
but the comment not adjusted.

Change-Id: I1d4cc06e9e5631955ff73bf675090cf9c33c9390
2019-05-15 16:04:32 +02:00
Translation updater bot 9cb58a4737 Localisation updates from https://translatewiki.net.
Change-Id: I5d5c31e4e1b151c1af2c7afdf1bdaa81767906fd
2019-05-15 09:11:22 +02:00
jenkins-bot 2d98b50a43 Merge "Remove call to deprecated User::isBlocked" 2019-05-14 13:33:39 +00:00
Thalia f23905c402 Remove call to deprecated User::isBlocked
Change-Id: Ibb7412f8aa08a745a211b9b0581ccb6b0ca9eff5
2019-05-14 13:14:57 +01:00
Translation updater bot 9b58deadc7 Localisation updates from https://translatewiki.net.
Change-Id: Iaf97a66213e8b0a93ba5e3196036881c17628607
2019-05-13 23:20:00 +02:00
Translation updater bot 830f3c4220 Localisation updates from https://translatewiki.net.
Change-Id: I0f89b49ecc8a4fcf612ae8c4ebd54e947345a8b8
2019-05-12 22:31:56 +02:00
jenkins-bot 673b0c8435 Merge "Localisation updates from https://translatewiki.net." 2019-05-10 07:22:27 +00:00
Translation updater bot d4c4b66393 Localisation updates from https://translatewiki.net.
Change-Id: I1792a888943c20398a55ef9ecbb49b4bbe03ad73
2019-05-10 09:17:27 +02:00
Translation updater bot c834491468 Localisation updates from https://translatewiki.net.
Change-Id: I794697930b5d3ec775900fbe82f5e3b121797ede
2019-05-09 08:45:47 +02:00
James D. Forrester bdf8c2a39b build: Upgrade eslint-config-wikimedia 0.12.0, drop grunt-jsonlint
Bug: T220036
Change-Id: Ib35f5c3bd970233ab8b415c206cb8e606ac1f55b
2019-05-06 13:56:54 -07:00
Translation updater bot e25fbc5ee4 Localisation updates from https://translatewiki.net.
Change-Id: I2fb2cdc842c284cd71650b12de718d50a36551d1
2019-05-05 22:19:50 +02:00
Translation updater bot b3cd8790c7 Localisation updates from https://translatewiki.net.
Change-Id: I47104530cc7730c757040ecce159ad27d6f1dd2c
2019-05-03 22:20:47 +02:00
Translation updater bot 7189bbfee0 Localisation updates from https://translatewiki.net.
Change-Id: I7d6ae9858dd55ca0f266207db14679050e258e98
2019-05-01 22:29:25 +02:00
jenkins-bot 06cac3682e Merge "Replace deprecated cache-related functions" 2019-05-01 16:27:56 +00:00
Translation updater bot da29ae0575 Localisation updates from https://translatewiki.net.
Change-Id: Ic7db4b15cabcbe09c3ff6e62ba56d683aef535aa
2019-04-30 22:17:07 +02:00
Translation updater bot 0f2c95cc42 Localisation updates from https://translatewiki.net.
Change-Id: I0e756990238e3d12d3eb250a4f58ff7542efc9bd
2019-04-29 22:14:55 +02:00
Translation updater bot 46416c449e Localisation updates from https://translatewiki.net.
Change-Id: Ifc774f68a65eab84fbe3e6011e044717e06a29af
2019-04-26 22:26:56 +02:00
Translation updater bot d7170e1116 Localisation updates from https://translatewiki.net.
Change-Id: I7759b1107258fd695cfd7df440cd33f763d45fcd
2019-04-24 22:20:16 +02:00
Translation updater bot 875fa9a9e9 Localisation updates from https://translatewiki.net.
Change-Id: I248f204706ffe3d934599213c877fc19c6a3059a
2019-04-23 22:44:27 +02:00
Daimona Eaytoy 2276d8ed2a Refactor tokenizer caching
Split a method, use WAN cache so that we're enabled to use
getWithSetCallback, pass the "version" option there and adapt the test
to it.
Follow-up of I9b3bc36b552901bc6ca7609ee51e80be2979a9c4

Change-Id: I4dd81a723e2bdb828b90594ad66a3918d8ec5b6c
2019-04-23 19:38:10 +02:00
jenkins-bot cf491b18f7 Merge "Avoid sending stashing statsd data for bots in AbuseFilter::filterAction" 2019-04-23 14:08:38 +00:00
Aaron Schulz bc04dd93fe Avoid sending stashing statsd data for bots in AbuseFilter::filterAction
Change-Id: Ic06f64c22fc94665e58620a98e17264d48c97deb
2019-04-22 17:45:51 -07:00
Translation updater bot 9ae5f6b22c Localisation updates from https://translatewiki.net.
Change-Id: I18d0edc7c0aa4a9e27899c8e7609632bc68e2fe7
2019-04-22 09:22:08 +02:00
Translation updater bot 5ee6ec86b7 Localisation updates from https://translatewiki.net.
Change-Id: I35a3b88d44bcac062e5bc06197b535a040fe6ae1
2019-04-19 09:52:09 +02:00
jenkins-bot cdad0e1a14 Merge "Revert "Use string cast for Postgres compatibility"" 2019-04-18 15:31:51 +00:00
Daimona Eaytoy 9a315f2a6e Revert "Use string cast for Postgres compatibility"
This reverts commit 4ab12305f1.

Bug: T221357
Change-Id: Id0f26f48ad9904e73a8b65d76586957c2be93e82
2019-04-18 11:51:16 +00:00
jenkins-bot 968bd9b817 Merge "Add tests for tokenizer caching" 2019-04-17 23:27:19 +00:00
Translation updater bot d3fcfc4a41 Localisation updates from https://translatewiki.net.
Change-Id: I81f060370e6d6ec9d9d0a538cf0ffc7c9b920eeb
2019-04-17 22:12:35 +02:00
Aryeh Gregor b222330a61 Don't try to move onto an existing page in tests
I didn't fix every case where this happens, just what blocks
I6ddcc9f34a48f997ae39b79cd2df40dd2cc10197 from landing.

Change-Id: I971e619eb76c4474fe037fad258f9c496717bf41
2019-04-17 17:23:23 +03:00
Translation updater bot 1abc4b6d2e Localisation updates from https://translatewiki.net.
Change-Id: Idffa7ff075292298f0824c707ba9bac21319634e
2019-04-15 22:52:32 +02:00
Daimona Eaytoy 4b10a544ab Add tests for tokenizer caching
Caching the result of the tokenization is pretty important
performance-wise, so this test ensures that caching works as expected.
I have also extracted the method used to generate the cache key for
easier testing, and moved the cache instance to a class member because
otherwise that piece of code can't be tested...

Bug: T201193
Change-Id: I9b3bc36b552901bc6ca7609ee51e80be2979a9c4
2019-04-15 16:59:55 +02:00
Translation updater bot a0cd8f72b7 Localisation updates from https://translatewiki.net.
Change-Id: I2baf445976083a183ae87904cc2575f987777158
2019-04-14 22:28:56 +02:00
Daimona Eaytoy ec110c657b Add tests for various data type casts
These are the ones which other tests don't cover, mostly because no
filter syntax can trigger those cases. This patch should bring coverage
for AFPData to 100%.

Bug: T201193
Change-Id: I997576141943959d4602a9f839311108928ec766
2019-04-14 14:08:57 +02:00
Daimona Eaytoy 23fe973544 Remove pointless number cast
If the number is int there's not need to intval it, and if it's float
there's no need to floatval... Just use it to determine the internal
data type, like it happens for sum and sub.

Change-Id: Ie00c4bb4e67ad1eface0cea3eb42d04aa5fb39cc
2019-04-14 10:49:09 +02:00
Daimona Eaytoy 909eec6716 Tweak coverage part 2
Follow-up of Ic30883f7d261d974a2be46308d023e2714119e95, with two files
that I forgot to git-add and a repositioning of comments to avoid the
last bracket to be reported as uncovered.

Bug: T201193
Change-Id: I6bf7e5892a0f49f6a138792f0aedf230a70c18a8
2019-04-13 19:26:01 +02:00
Daimona Eaytoy 4bcb64b01a Increase code coverage a bit
This patch mostly adds coverageIgnore comments for intendedly
unreachable code etc. Some of them could be made testable by adding a new
filter function (e.g. array cast), but this patch is meant to be
comment-only (aside from the parser test).
Ignoring coverage for these lines makes some methods reach 100%
coverage, which in turn makes it easier to look at the coverage chart
and identify at a glance which parts of the code *really* need to be
covered.

Bug: T201193
Change-Id: Ic30883f7d261d974a2be46308d023e2714119e95
2019-04-13 18:30:14 +02:00