Commit graph

6613 commits

Author SHA1 Message Date
jenkins-bot 319789827c Merge "Use \h instead of \s in regular expressions" 2018-10-11 22:11:58 +00:00
Thiemo Kreuz 44f861496f Replace two regular expressions with cheap string manipulations
Note that the array of matches returned by preg_match changes when
PREG_OFFSET_CAPTURE is set. That's why the additional [0] (for the
match) and [1] (for the offset) are needed.

Bug: T203930
Change-Id: I89f9ea3bef49fe9128fd42805695982f012ecba9
2018-10-11 10:59:04 +02:00
Max Semenik e5e8de1ba6 Add a test to validate $wgEchoNotifications
Change-Id: I7c9f76f4222f692a2babf47618b869f4c963499f
2018-10-10 19:07:04 -07:00
Volker E e75002fa7c Update icons with overhauled user avatar
Bug: T123810
Change-Id: Ibcb442412963dcf0bc74805792a6e7dac13ec47e
2018-10-09 23:24:31 -07:00
Alangi Derick 873df84e49 Fix php tag in SpecialDisplayNotificationsConfiguration.php
Change-Id: Ib95e906ae9659e7613cd78ae24225cc5e4350758
2018-10-08 18:49:06 +01:00
jenkins-bot 53ea4486fd Merge "Handle revision not found" 2018-10-05 22:28:58 +00:00
Translation updater bot ddf639682d Localisation updates from https://translatewiki.net.
Change-Id: Ied5560f213430590c680e81a1c6d62fa1ce691e8
2018-10-05 22:59:06 +02:00
Stephane Bisson 9f37ba0511 Handle revision not found
Some Echo events include 'revid' in their extra info.
It can be used to check if a revision is minor in order
to respect the 'enotifminoredits' preference.

This patch ensures that it is not trying to call a function on
a null revision reference and it logs to debug to help
troubleshooting.

Also encapsulate the "is minor" check to a private function
to (hopefully) make the relationship with the preference
more clear.

Bug: T204795
Change-Id: I28a4c54f610dccc1356f6af0de9c2623d7bf94f0
2018-10-05 09:11:58 -04:00
Translation updater bot 7737c2da2f Localisation updates from https://translatewiki.net.
Change-Id: Ie8031e87ed5f7bbeadd9a17cca45f7aa9807d1d8
2018-10-04 22:24:11 +02:00
jenkins-bot a88c189301 Merge "Remove expensive regular expression that doesn't have any effect" 2018-10-04 13:23:28 +00:00
Translation updater bot ca95c1d23a Localisation updates from https://translatewiki.net.
Change-Id: Ic4e8e7e04ea02df5337a4903b7b9d903497cca14
2018-10-04 14:24:27 +02:00
Translation updater bot ee7bba04ec Localisation updates from https://translatewiki.net.
Change-Id: Ida9156a3e6b0378cd653edf8ecb0619f4a07d874
2018-10-03 18:53:14 +02:00
Umherirrender d6e85e1300 Fix loggroup name in NotificationController::getUsersToNotifyForEvent
Using {closure} seems not helpful

Change-Id: I67ee2d6e48226cc079cb290ca7dd63407eb85883
2018-09-30 14:22:35 +02:00
Translation updater bot 52aa30c077 Localisation updates from https://translatewiki.net.
Change-Id: I2dc98237f7f28839ef739466f5c09287343501c3
2018-09-26 13:45:47 +02:00
jenkins-bot 4666871d53 Merge "Remove U+200E (LRM) from comments" 2018-09-26 08:13:23 +00:00
jenkins-bot e29ecab5e0 Merge "Don't override checkmatrix defaults set elsewhere" 2018-09-25 20:50:04 +00:00
Thiemo Kreuz acba72e011 Remove expensive regular expression that doesn't have any effect
See, this last part of the compiled regular expression is wrapped in
an (…)*, which means it is entirely optional. It does not make any
difference if this part is found or not. The compiled regular
expression matches with or without any of these "line ending"
fragments being present.

I can not really figure out what the intention of this was. A line
ending anchor ($) is not missing – I'm pretty sure about this.
Otherwise it could not detect signatures that are wrapped in more
than a single HTML tag, for example.

Instead of fixing it I decided to remove it. The tests should show
this code was not needed.

The motivation for this patch is to improve performance. This part of
the regular expression is quite heavy and can cause a lot of
backtracking for literally zero benefit.

Bug: T203930
Bug: T204291
Change-Id: Ia5323b401b947edeb7094d7eec131ba6c80edf70
2018-09-25 18:15:49 +02:00
Thiemo Kreuz 17762b3b29 Use \h instead of \s in regular expressions
\h matches only horizontal whitespace, but no newlines. This is what
we want in all these cases, because nothing of this (headlines,
signatures, timestamps) is even allowed to span multiple lines in
wikitext. The tests should show this still succeeds.

The idea is to make these regular expressions more strict so they
don't run in so much expensive backtracking.

Bug: T203930
Bug: T204291
Change-Id: I805f8cb082edcd26713ef41d3ae5b61194c131e5
2018-09-25 18:09:51 +02:00
Thiemo Kreuz 0c7bd7dbc8 Wrap unknown \A escape sequence in single quotes
In double quoted strings PHP tries to understand all kinds of escape
sequences, but \A is not one of them. Such sequences are left untouched,
including the backslash.

In single quoted strings, there are no escape sequences. All are left
untouched, which is what we want in case of a regular expression.

TL;DR: The resulting string is the same in both cases. I'm touching this
because my IDE shows a warning about the unknown \A escape sequence.
It must be either turned into "\\A" or '\A'.

Change-Id: Ie1e84c67c344faf77bc86a0b28dc82d31c3a7dbe
2018-09-25 18:05:40 +02:00
Fomafix 08d1224c73 Remove U+200E (LRM) from comments
Change-Id: I7a0b0df2b11155fd3e702f2cc510256cc648eb3d
2018-09-24 22:15:51 +02:00
Translation updater bot 7d2aa4a596 Localisation updates from https://translatewiki.net.
Change-Id: Ic012d6e25be9df449b1ec6cdc7bce2f6c7540f58
2018-09-24 09:18:00 +02:00
Translation updater bot 0af3c920f8 Localisation updates from https://translatewiki.net.
Change-Id: Ic5a93a95830511f46ad68309422cbe0f3c1a69fc
2018-09-23 10:26:53 +02:00
Translation updater bot 81fae8bc80 Localisation updates from https://translatewiki.net.
Change-Id: Ie37a8870329df20f4aaa0d07e1d04f0d45a8149d
2018-09-22 10:03:31 +02:00
Max Semenik b82b54f0a6 Don't override checkmatrix defaults set elsewhere
Bug: T174220
Change-Id: I3c9bc06ff78040f88f7f870671c838dad4e3ad6d
2018-09-20 17:15:09 -07:00
jenkins-bot dfffe476b9 Merge "ApiCrossWiki: Handle needsToken() returning false" 2018-09-19 10:50:11 +00:00
Translation updater bot 41a521d9fd Localisation updates from https://translatewiki.net.
Change-Id: Ie9bc9c3e443cc74c2631a95f75d1e1cd41cf0e76
2018-09-19 10:00:46 +02:00
Stephane Bisson 330810614d ApiCrossWiki: Handle needsToken() returning false
false ?? null evaluates to false, so for non-write modules we were
passing false as the token type instead of null, which breaks.

Bug: T204758
Change-Id: Ief25150ce8f4b4b64a224f97f3fd528883b2f326
2018-09-18 17:21:50 -04:00
Translation updater bot be440a475c Localisation updates from https://translatewiki.net.
Change-Id: Ic3ede8532d9567caa22c6d08525e8ff256be6560
2018-09-18 09:52:14 +02:00
Translation updater bot 58a9f2583d Localisation updates from https://translatewiki.net.
Change-Id: Ic63f271f66c2c984b48fbea0475d5ea5958a3223
2018-09-17 10:17:42 +02:00
Umherirrender 1345b056c2 Add @group Database to unit test
Used database by inserting pages

Change-Id: If97d9e6e525465ca3879003e71dd5e67fc0afdfd
2018-09-14 22:29:34 +02:00
Brian Wolff 983a01bdff Build: Make pass phan-taint-check 1.5.0
Disable some errors related to different members of an array
having different taints, and phan-taint-check conflating them.

Bug: T202383
Change-Id: Ic6c2c5bb7c6092d581e646358d836f55d5cf3222
2018-09-14 02:04:03 +00:00
jenkins-bot 16dc34eb51 Merge "Add @group Database to unit test" 2018-09-12 22:23:18 +00:00
jenkins-bot b255d9ec5a Merge "Remove obsolete scripts/generatecss.php" 2018-09-12 20:52:09 +00:00
Umherirrender 00fe420a1f Add @group Database to unit test
Follow-Up: I4cdc8130032340726c5d18d795cd2d6b6b58b307
Change-Id: Iac4458d24838198f530a5a0e738f6dc4db0f9b56
2018-09-12 22:38:23 +02:00
jenkins-bot 6e9b0449f4 Merge "Replace deprecated 'advanced' by renamed to 'settings' icon" 2018-09-12 16:45:29 +00:00
Translation updater bot 2c786bb298 Localisation updates from https://translatewiki.net.
Change-Id: I86526abe2b64853171dbe786246758fddd46002b
2018-09-12 09:18:48 +02:00
Ed Sanders 2c089e075d build: Update linters
Change-Id: I9747097fdf725992710f97d4ce4ea49fd611df1b
2018-09-11 23:46:52 +01:00
jenkins-bot 8fff5360d9 Merge "Fix phpunit @group annotation" 2018-09-10 09:11:13 +00:00
Translation updater bot cebbc2e64b Localisation updates from https://translatewiki.net.
Change-Id: I064146365ec2923aedca1483352b7c8f0768ed94
2018-09-10 09:31:53 +02:00
Kunal Mehta a7cf20d9fe Remove obsolete scripts/generatecss.php
Clearly broken, as it tries to include a non-existing Resources.php file.

Also it's pretending to be MediaWiki 1.23, which is plenty old.

It was supposed to be run via the Makefile, but that's been broken since at
least 111b671444. If this functionality of identifying duplicate CSS rules
is still wanted, I'm sure there's a better way to do it than with a hacky PHP
script and a ruby tool.

Mainly removed since it's causing a phan-taint-check-plugin warning (T202383).

Change-Id: Id1d117f41f93adec4bba7191843aa415c4049d5f
2018-09-09 17:07:26 -07:00
Umherirrender 8429547776 Fix phpunit @group annotation
Change-Id: Ic6c2c5bb7c6092d581e646358d836f55d5cf38b0
2018-09-09 20:41:59 +02:00
Translation updater bot 1c51a034c5 Localisation updates from https://translatewiki.net.
Change-Id: I9c254edbdeb21c52b3ee2178f78fda3fe7bc8861
2018-09-09 10:36:05 +02:00
Translation updater bot 615ff2eb57 Localisation updates from https://translatewiki.net.
Change-Id: I78d8fdcae73a6ae8246f9189c317763f0335764b
2018-09-08 10:39:14 +02:00
Volker E 8423a7ce53 Replace deprecated 'advanced' by renamed to 'settings' icon
Bug: T190581
Change-Id: I63f3252464cd6098e89ff49d0e9881440c6679f8
2018-09-07 19:57:10 -07:00
Translation updater bot 087a41faaf Localisation updates from https://translatewiki.net.
Change-Id: I6c5ca5c1dddd8e373fa7a9571c41290120ec4dcb
2018-09-07 09:02:39 +02:00
daniel c06ca6d111 Test data providers should never access the database.
Any database access in test providers is hitting the live
database, not the test mock!

Change-Id: I01d8c41ed30cfaf68642c218090147ac39757c5e
2018-09-07 01:24:52 +00:00
Translation updater bot df9b9e14a9 Localisation updates from https://translatewiki.net.
Change-Id: I22dc0d499d79d9d5c22e73b7d214c87a38a81dac
2018-09-06 09:01:04 +02:00
jenkins-bot 9eebe652a7 Merge "Fix HTML escaping on Special:DisplayNotificationsConfiguration" 2018-09-05 12:56:57 +00:00
jenkins-bot b6f4e9d133 Merge "Make markasread parameter work cross-wiki" 2018-09-05 12:40:34 +00:00
jenkins-bot 9fad958301 Merge "Use API proxying for markasread requests in the front end" 2018-09-05 12:40:31 +00:00