Commit graph

4930 commits

Author SHA1 Message Date
Aaron Schulz 9a0ce7d4d7 Avoid use of IDatabase::update return value
Change-Id: I0739c2dcd22aa0536257e534dd1eb0d44d3f016b
2018-10-26 13:56:30 -07:00
Aaron Schulz 9cca289625 Avoid use of IDatabase::update return value
Change-Id: I6780b4ca7051daee38d9155632a556455c434b67
2018-10-26 12:46:58 -07:00
Aaron Schulz deb5057dc6 Avoid use of IDatabase::update return value
Change-Id: I7f3a0f169cfac9190b796b45aabb1b9cb7670a9d
2018-10-26 12:41:49 -07:00
jenkins-bot 84fbb3da29 Merge "Reload the test user instance before checking the edit count" 2018-10-25 21:22:36 +00:00
Thiemo Kreuz 611d1610dd Simplify testDiscussionParser code
I found this code while looking for possibly problematic count()s.

I noticed the line "$user = $pageData['revisions'][0]…", which means
the code assumes element [0] is always there. Therefore I droped the
"count() == 1" check.

The other count() got replaced with an isset().

Change-Id: Ic582c85d07db0cbed56512e3e381120b628f2288
2018-10-25 19:23:07 +00:00
Zoranzoki21 3f42e2956f Fix HTTP links to HTTPS for www.mediawiki.org
Bug: T189687
Change-Id: I1990cabfa813f7eabe935ce81644d568f99215ea
2018-10-23 20:58:50 +00:00
Aaron Schulz 9c26779852 Reload the test user instance before checking the edit count
These are updated in deferred updates and should not rely on the same
User instance being used in those updates. This also avoids convoluted
logic in User to set the new edit count for various cases.

Change-Id: I0ad3d17107efc7b0e59f1dd54d5733cd1572a2b7
2018-10-23 11:01:35 -07:00
Thiemo Kreuz 5cf0e6273f Add missing limits to explode() where possible
For the algorithms in question this does not make any difference. Excess
elements are thrown away anyway. This is for performance.

Change-Id: I645e389b3f993bc8015fd729b9302aa25471f833
2018-10-20 09:11:19 +00:00
Thiemo Kreuz 8c51f5bd45 Avoid count()ing where not necessary
If all the code needs to know is if an array is empty or not, using
count() creates more confusion than anything.

Change-Id: I253308505fe5af5b5c56d85169789271967298ba
2018-10-19 10:04:24 +02:00
Translation updater bot a193185a1f Localisation updates from https://translatewiki.net.
Change-Id: I0fc664629690d42b716b5494ef7b9dfe46190894
2018-10-17 23:44:07 +02:00
Translation updater bot dd02b4b5e6 Localisation updates from https://translatewiki.net.
Change-Id: I30891370deeb9cb1070e88b75fb8a94b43f1d4e8
2018-10-16 22:17:20 +02:00
jenkins-bot 78d94c33d8 Merge "Update references to re-namespaced RevisionStore" 2018-10-15 21:48:28 +00:00
Translation updater bot 2028e84393 Localisation updates from https://translatewiki.net.
Change-Id: I2ce3278a4a9e002502bd462a6d08092bb7898feb
2018-10-15 22:15:57 +02:00
libraryupgrader 07d8da720b build: Updating npm dependencies for security issues
* Updated grunt-contrib-watch to 1.1.0, addressing:
  * https://npmjs.com/advisories/534
  * CVE-2017-16137
  * https://npmjs.com/advisories/577
  * CVE-2018-3721

Change-Id: I9551effaeda59a12cf56090479515521e76c0679
2018-10-13 18:09:42 +00:00
jenkins-bot f6927d714f Merge "Add a test to validate $wgEchoNotifications" 2018-10-13 06:17:35 +00:00
Kunal Mehta dbf44b1be7 Don't call count() with a non-countable value
Triggers a warning in PHP 7.2.

Bug: T206541
Change-Id: I5c25b59cd91871fcdbbf73e01af5a61c05c5fffd
2018-10-12 20:49:42 -07:00
James D. Forrester 8e0878df3a Update references to re-namespaced RevisionStore
Change-Id: If19981aba01ef9aac68bcd731d6912ea827fcfe5
2018-10-12 11:14:14 -07:00
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