lhc/web/wiklou.git
4 years agoAPI: Warn about POST without Content-Type
Brad Jorsch [Mon, 19 Aug 2019 16:45:56 +0000 (12:45 -0400)]
API: Warn about POST without Content-Type

HHVM sniffs the content type and so probably correctly guesses
application/x-www-form-urlencoded and fills in $_POST, while PHP 7 does
not sniff and so doesn't fill in $_POST.

Since there are clients that have been expecting the HHVM behavior, give
a warning both to let them know and so we can have some idea of how many
such clients there are.

This also adds any warnings and errors as an HTML comment at the top of
the auto-generated help page, to hopefully make it easier for people
getting that unexpectedly to find out why.

Bug: T230735
Change-Id: I017b7afe808844d74d376f6436894a5a2f525a9f

4 years agoMerge "Use injected services instead of static method"
jenkins-bot [Mon, 19 Aug 2019 16:04:04 +0000 (16:04 +0000)]
Merge "Use injected services instead of static method"

4 years agoMerge "Convert MessageCache to service"
jenkins-bot [Mon, 19 Aug 2019 16:03:56 +0000 (16:03 +0000)]
Merge "Convert MessageCache to service"

4 years agoMerge "Add recursion check to createService()"
jenkins-bot [Mon, 19 Aug 2019 15:36:40 +0000 (15:36 +0000)]
Merge "Add recursion check to createService()"

4 years agoMerge "Revert "Clean up ApiEditPage content handler undo logic""
jenkins-bot [Mon, 19 Aug 2019 15:11:20 +0000 (15:11 +0000)]
Merge "Revert "Clean up ApiEditPage content handler undo logic""

4 years agoRevert "Clean up ApiEditPage content handler undo logic"
Anomie [Mon, 19 Aug 2019 14:49:30 +0000 (14:49 +0000)]
Revert "Clean up ApiEditPage content handler undo logic"

This reverts commit 01564dcbf76cd279c88320f96f0844cfadf4f7c9.

Reason for revert: I find the empty case far clearer as to intention than this change, and I doubt this is such a hot path that optimization should take precedence over clarity. If we really want to get rid of the empty case, I'd have structured it somewhat clearly as

 if (
     // always allow undo via api, T230702
     !( $params['undo'] > 0 ) &&
     // [something else here to explain this clause]
     $contentHandler->supportsDirectApiEditing() === false
 ) {

But even that is IMO less clear. At the very least this seems to deserve more discussion.

Bug: T230702
Change-Id: Icc16250faad31abf7308c4af9be2e7658540346c

4 years agoMerge "Remove 'redundant' attribute from BaseTemplate::makeListItem() links in case...
jenkins-bot [Mon, 19 Aug 2019 14:10:51 +0000 (14:10 +0000)]
Merge "Remove 'redundant' attribute from BaseTemplate::makeListItem() links in case this is not done in SkinTemplate::buildContentActionUrls()"

4 years agoMerge "Add suppressredirect right to the createeditmovepage grant"
jenkins-bot [Mon, 19 Aug 2019 12:14:04 +0000 (12:14 +0000)]
Merge "Add suppressredirect right to the createeditmovepage grant"

4 years agoMerge "MySQL connect: Parse the Unix domain socket path correctly"
jenkins-bot [Mon, 19 Aug 2019 10:47:45 +0000 (10:47 +0000)]
Merge "MySQL connect: Parse the Unix domain socket path correctly"

4 years agoMerge "Clean up ApiEditPage content handler undo logic"
jenkins-bot [Mon, 19 Aug 2019 10:29:13 +0000 (10:29 +0000)]
Merge "Clean up ApiEditPage content handler undo logic"

4 years agoClean up ApiEditPage content handler undo logic
DannyS712 [Mon, 19 Aug 2019 02:13:32 +0000 (02:13 +0000)]
Clean up ApiEditPage content handler undo logic

Bug: T230702
Change-Id: I79d528866c54f40c5adcffde8410b9e2d5336ea7

4 years agoMerge "Select "move subpages" by default when moving a page"
jenkins-bot [Mon, 19 Aug 2019 07:51:46 +0000 (07:51 +0000)]
Merge "Select "move subpages" by default when moving a page"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 19 Aug 2019 06:51:49 +0000 (08:51 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I298e4b5253f73c1e2d3a385a4ea5eb1369e432aa

4 years agoMerge "Fix doc for MediaWikiIntegrationTestCase::getTestSysop"
jenkins-bot [Sun, 18 Aug 2019 12:14:25 +0000 (12:14 +0000)]
Merge "Fix doc for MediaWikiIntegrationTestCase::getTestSysop"

4 years agoFix doc for MediaWikiIntegrationTestCase::getTestSysop
DannyS712 [Sun, 18 Aug 2019 03:42:02 +0000 (03:42 +0000)]
Fix doc for MediaWikiIntegrationTestCase::getTestSysop

Bug: T230670
Change-Id: Icd57ef2f6268d362a0912931911c46f93165d4ff

4 years agoConvert MessageCache to service
Aryeh Gregor [Mon, 8 Apr 2019 15:21:49 +0000 (18:21 +0300)]
Convert MessageCache to service

Depends-On: Ia70e6c75f6e8a533f20cd44ebb05e013678e9951
Depends-On: I546eda0377f3a50843144b1450d3fbe8e4e02a8a
Change-Id: I305539a8598535a73e5cd280b2becdafa740ef97

4 years agoAdd recursion check to createService()
Aryeh Gregor [Wed, 14 Aug 2019 11:46:47 +0000 (14:46 +0300)]
Add recursion check to createService()

This will throw when trying to create a service while already in the
process of creating that same service, i.e., if there's a circular
service dependency. This would have saved me a whole bunch of debugging
time. :)

Change-Id: Id148d4f221f35f4069f3e0ab0069d13ca271df3d

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 18 Aug 2019 06:51:34 +0000 (08:51 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Iee50e7133afa7491e1a29e5d4600bf99cc259dbd

4 years agoMerge "skins: Hard-deprecate QuickTemplate::msgWiki()"
jenkins-bot [Sun, 18 Aug 2019 03:23:34 +0000 (03:23 +0000)]
Merge "skins: Hard-deprecate QuickTemplate::msgWiki()"

4 years agoMerge "Fix typos in code"
jenkins-bot [Sat, 17 Aug 2019 12:11:44 +0000 (12:11 +0000)]
Merge "Fix typos in code"

4 years agoskins: Hard-deprecate QuickTemplate::msgWiki()
Piotr Miazga [Fri, 16 Aug 2019 15:52:52 +0000 (17:52 +0200)]
skins: Hard-deprecate QuickTemplate::msgWiki()

Add wfDeprecated() call as MediaWiki 1.33 has been released.

Change-Id: Ied80b7b23bad21af113d4d6f6e19c22064e3125c

4 years agoMerge "Remove title protection correctly for undeletions and imports"
jenkins-bot [Sat, 17 Aug 2019 09:27:34 +0000 (09:27 +0000)]
Merge "Remove title protection correctly for undeletions and imports"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 17 Aug 2019 06:53:10 +0000 (08:53 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I487111cd57cb185b6a9c3222e4527fca72214de3

4 years agoMerge "Handle changed defaults in Argon2PasswordTest::testPartialConfig()"
jenkins-bot [Sat, 17 Aug 2019 02:07:08 +0000 (02:07 +0000)]
Merge "Handle changed defaults in Argon2PasswordTest::testPartialConfig()"

4 years agoMerge "Fix IDatabase::affectedRows() documentation"
jenkins-bot [Sat, 17 Aug 2019 01:41:08 +0000 (01:41 +0000)]
Merge "Fix IDatabase::affectedRows() documentation"

4 years agoHandle changed defaults in Argon2PasswordTest::testPartialConfig()
Brad Jorsch [Fri, 16 Aug 2019 18:44:29 +0000 (14:44 -0400)]
Handle changed defaults in Argon2PasswordTest::testPartialConfig()

PHP 7.2.21 and 7.3.8 changed the default settings for PASSWORD_ARGON2I.
Load the default settings at runtime so the test can work.

Bug: T230487
Change-Id: I55a0f1af160c822113c9f86f8f8cce558da61736

4 years agoRecentChangesUpdateJob: Fix GROUP BY
Brad Jorsch [Fri, 16 Aug 2019 18:02:56 +0000 (14:02 -0400)]
RecentChangesUpdateJob: Fix GROUP BY

When a column specified in GROUP BY is both a table column and a
SELECT-field, MySQL and PostgreSQL both interpret it as the table column
rather than the SELECT-field.

In PostgreSQL this raises an error, which is good since it lets us know
it needs fixing. But MySQL goes ahead and groups by the table field
which gives us the wrong result.

Bug: T230618
Change-Id: Id500556b2795b86849329eece3b651b08e29a7f7

4 years agoActiveUsersPager: Fix outer GROUP BY
Brad Jorsch [Fri, 16 Aug 2019 17:57:51 +0000 (13:57 -0400)]
ActiveUsersPager: Fix outer GROUP BY

MySQL doesn't care, but PG actually enforces rules about GROUP BY
columns.

Bug: T230618
Change-Id: If769db525bf53c906ad3e0e1d1a6e92194f622a8

4 years agoMerge "Remove unused variables from setupTemplate"
jenkins-bot [Fri, 16 Aug 2019 17:39:53 +0000 (17:39 +0000)]
Merge "Remove unused variables from setupTemplate"

4 years agoCheck all slots in DerivedPadeDataUpdater::isCountable.
Petr Pchelko [Tue, 13 Aug 2019 21:52:39 +0000 (14:52 -0700)]
Check all slots in DerivedPadeDataUpdater::isCountable.

For example when the page is moved, the slots are not actually
modified, so countability of the page after the update should
not be based only on modified slots, but instead on all the page
slots.

Bug: T212706
Change-Id: Ie352ec9307b89b04af09ed85b542ca2907856bbf

4 years agoRemove 'redundant' attribute from BaseTemplate::makeListItem() links
Isarra [Fri, 16 Aug 2019 16:46:32 +0000 (16:46 +0000)]
Remove 'redundant' attribute from BaseTemplate::makeListItem() links
in case this is not done in SkinTemplate::buildContentActionUrls()

Not all skins are going to use buildContentActionUrls() in the first
place, as they may not be laying out the usual action tabs as, well,
the usual action tabs. Given that this is being added in core, it
should likewise be cleaned up in core.

Bug: T214202
Change-Id: I630410aea2852f7a72fea67bbf256b3561ea0f3f

4 years agoRemove unused variables from setupTemplate
Piotr Miazga [Fri, 16 Aug 2019 16:40:14 +0000 (18:40 +0200)]
Remove unused variables from setupTemplate

Both $repository and $cache_dir are never used, no other skin/
extension makes use of that, variables are defined just because of
PHP Strict standards.

IMHO there is no need to define those, all Skins that extend
Skin class define optional params so PHP will not complain.

Change-Id: I059415a795e5836b9399890ecfd4fb5ee1888ac3

4 years agoRemove title protection correctly for undeletions and imports
GeoffreyT2000 [Thu, 9 May 2019 00:56:15 +0000 (17:56 -0700)]
Remove title protection correctly for undeletions and imports

Undeletions and imports can both produce "new" pages with more than
1 revision. The fact that $options['created'] for the associated
DerivedPageDataUpdater instance is unexpectedly changed to false is due
to the fact that the latest revision often has a nonzero rev_parent_id.
This causes WikiPage::onArticleCreate not to be applied correctly, and
so title protection is not correctly removed. The part about "created"
being forced is therefore being fixed.

Bug: T200088
Change-Id: I8c899893486976285eb6fac87d641e93a616676d

4 years agoMerge "Introduce TitleParser::makeTitleValueSafe()"
jenkins-bot [Fri, 16 Aug 2019 12:32:03 +0000 (12:32 +0000)]
Merge "Introduce TitleParser::makeTitleValueSafe()"

4 years agoFix IDatabase::affectedRows() documentation
Gergő Tisza [Fri, 16 Aug 2019 12:06:10 +0000 (14:06 +0200)]
Fix IDatabase::affectedRows() documentation

Bug: T229456
Change-Id: I992e81e5dbcd9db74644b2990044cf685567db5a

4 years agoMerge "Comma list handled via CSS in change list pages"
jenkins-bot [Fri, 16 Aug 2019 11:54:05 +0000 (11:54 +0000)]
Merge "Comma list handled via CSS in change list pages"

4 years agoMerge "rdbms: ignore DBO_NOBUFFER flag in IDatabase"
jenkins-bot [Fri, 16 Aug 2019 11:28:50 +0000 (11:28 +0000)]
Merge "rdbms: ignore DBO_NOBUFFER flag in IDatabase"

4 years agoComma list handled via CSS in change list pages
jdlrobson [Thu, 15 Aug 2019 17:33:15 +0000 (10:33 -0700)]
Comma list handled via CSS in change list pages

This avoids unnecessary commas in the mobile interface.

Bug: T230564
Change-Id: Id486e9a5b8fd337c41c8749d0462a40d6e68dffb

4 years agoMerge "Add Parser::resetOutput() and getStripState()"
jenkins-bot [Fri, 16 Aug 2019 08:38:56 +0000 (08:38 +0000)]
Merge "Add Parser::resetOutput() and getStripState()"

4 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Fri, 16 Aug 2019 06:34:45 +0000 (06:34 +0000)]
Merge "Localisation updates from https://translatewiki.net."

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 16 Aug 2019 06:33:53 +0000 (08:33 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I4f911ecc1aec466dabc18fd76853bc2b1defb906

4 years agoMerge "Correct English grammar in linkstoimage"
jenkins-bot [Fri, 16 Aug 2019 06:31:47 +0000 (06:31 +0000)]
Merge "Correct English grammar in linkstoimage"

4 years agoMerge "parser: use 'vary-revision-sha1' in Parser::statelessFetchTemplate"
jenkins-bot [Fri, 16 Aug 2019 00:07:49 +0000 (00:07 +0000)]
Merge "parser: use 'vary-revision-sha1' in Parser::statelessFetchTemplate"

4 years agoMySQL connect: Parse the Unix domain socket path correctly
JasonCoombs [Mon, 12 Aug 2019 04:38:48 +0000 (18:38 -1000)]
MySQL connect: Parse the Unix domain socket path correctly

Some Unix domain socket paths contain colons, requiring MediaWiki to use a modified parsing delimiter. For example,
Google AppEngine provides a /cloudsql/ path to a Unix domain socket used for accessing a Cloud SQL database.
See https://cloud.google.com/sql/docs/mysql/connect-app-engine
The connection name takes the form of project:region:database which introduces two additional colons to the socket path.
Previously, the code presumed the existence of only one colon in a valid Unix domain socket path.

Bug: T230306
Change-Id: I2411ac1b583fd5c143563cb3155ef4e8a29a9b08

4 years agoSECURITY: Add permission check for suppressed account
rxy [Tue, 13 Aug 2019 09:30:38 +0000 (18:30 +0900)]
SECURITY: Add permission check for suppressed account

Bug: T230402
Change-Id: I6a13859be81e5c746bdf0993eb5416fecdac2306

4 years agoMerge "API: Always select rc_user from database (regardless of rcprop=user)"
jenkins-bot [Thu, 15 Aug 2019 17:31:02 +0000 (17:31 +0000)]
Merge "API: Always select rc_user from database (regardless of rcprop=user)"

4 years agordbms: ignore DBO_NOBUFFER flag in IDatabase
Aaron Schulz [Thu, 15 Aug 2019 14:58:54 +0000 (10:58 -0400)]
rdbms: ignore DBO_NOBUFFER flag in IDatabase

Callers should use query batching instead. Without buffering, either
the RAM burden is shifted onto the RDBMS server (with MVCC vacuuming
also being stalled) or the RDBMS server has to keep adding locks as
the cursor advances. Also, if a caller does not read all the results
(possibly due to an exception), then the SQL commands sent/read get
out of sync, which is too fragile.

There are no DBO_NOBUFFER callers in WMF gerrit repos.

Change-Id: I3712149633d0f01bb6990e324e53dd58abba9cfd

4 years agordbms: deprecate seldom used bufferResults() method
Aaron Schulz [Sat, 27 Jul 2019 06:46:39 +0000 (02:46 -0400)]
rdbms: deprecate seldom used bufferResults() method

Change-Id: If67c91fa020f09a89fe2dd50fe4ad30b75d676ef

4 years agoAdd rate limiter to Special:ConfirmEmail
sbassett [Thu, 27 Jun 2019 20:18:54 +0000 (15:18 -0500)]
Add rate limiter to Special:ConfirmEmail

General hardening measure for Special:ConfirmEmail, similar to what's
already in place for Special:ChangeEmail.

Bug: T226733
Change-Id: I465e4748840e214531e930608386455084563bc6

4 years agoMerge "Add some tests for DerivedPageDataUpdater::isCountable."
jenkins-bot [Thu, 15 Aug 2019 10:02:24 +0000 (10:02 +0000)]
Merge "Add some tests for DerivedPageDataUpdater::isCountable."

4 years agoUse injected services instead of static method
Aryeh Gregor [Wed, 14 Aug 2019 18:23:38 +0000 (21:23 +0300)]
Use injected services instead of static method

Depends-On: I4b915244ceee4c1857178dd68dcdf57f1ee32200
Change-Id: I053894de3665c6f8f505ee6191f2ade843db62c0

4 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Thu, 15 Aug 2019 08:09:04 +0000 (08:09 +0000)]
Merge "Localisation updates from https://translatewiki.net."

4 years agoMerge "Use ExtensionRegistry instead of class name"
jenkins-bot [Thu, 15 Aug 2019 08:02:53 +0000 (08:02 +0000)]
Merge "Use ExtensionRegistry instead of class name"

4 years agoMerge "Drop last bits of oracle"
jenkins-bot [Thu, 15 Aug 2019 07:56:48 +0000 (07:56 +0000)]
Merge "Drop last bits of oracle"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 15 Aug 2019 06:27:59 +0000 (08:27 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ia9d0fee0c299f4f610acbc7cf151f3010f6b8e17

4 years agoAdd some tests for DerivedPageDataUpdater::isCountable.
Petr Pchelko [Thu, 15 Aug 2019 02:12:44 +0000 (19:12 -0700)]
Add some tests for DerivedPageDataUpdater::isCountable.

Change-Id: I82ed6fd604406d02faf4e966ec4845c8bc779a8b

4 years agoMerge "Add help links to special pages"
jenkins-bot [Wed, 14 Aug 2019 23:57:36 +0000 (23:57 +0000)]
Merge "Add help links to special pages"

4 years agoMerge "Rename variables for Title objects in PermissionManager"
jenkins-bot [Wed, 14 Aug 2019 23:31:21 +0000 (23:31 +0000)]
Merge "Rename variables for Title objects in PermissionManager"

4 years agoDrop last bits of oracle
Amir Sarabadani [Wed, 14 Aug 2019 21:25:00 +0000 (23:25 +0200)]
Drop last bits of oracle

Undefined constant

Change-Id: I66f17a7647bdcf254695dd0d3a0d49d41a35fff3

4 years agoMerge "Add drop of mssql/oracle to RELEASE-NOTES"
jenkins-bot [Wed, 14 Aug 2019 20:36:19 +0000 (20:36 +0000)]
Merge "Add drop of mssql/oracle to RELEASE-NOTES"

4 years agoAdd drop of mssql/oracle to RELEASE-NOTES
Amir Sarabadani [Wed, 14 Aug 2019 19:47:06 +0000 (21:47 +0200)]
Add drop of mssql/oracle to RELEASE-NOTES

Bug: T230418
Change-Id: Ie7771853048a27a8d8ee75764229e6e34477cd04

4 years agoMerge "Allow basic grant holders to autocreate accounts"
jenkins-bot [Wed, 14 Aug 2019 19:52:10 +0000 (19:52 +0000)]
Merge "Allow basic grant holders to autocreate accounts"

4 years agoMerge "maintenance/populateChangeTagDef.php: Handle missing valid_tags table"
jenkins-bot [Wed, 14 Aug 2019 19:25:54 +0000 (19:25 +0000)]
Merge "maintenance/populateChangeTagDef.php: Handle missing valid_tags table"

4 years agoMerge "More clean up of oracle/mssql"
jenkins-bot [Wed, 14 Aug 2019 19:25:12 +0000 (19:25 +0000)]
Merge "More clean up of oracle/mssql"

4 years agoMerge "Clear test user registry between tests"
jenkins-bot [Wed, 14 Aug 2019 18:59:31 +0000 (18:59 +0000)]
Merge "Clear test user registry between tests"

4 years agoIntroduce TitleParser::makeTitleValueSafe()
Aryeh Gregor [Tue, 13 Aug 2019 11:33:43 +0000 (14:33 +0300)]
Introduce TitleParser::makeTitleValueSafe()

This works exactly the same as Title::makeTitleSafe(), but for
TitleValues. 100% test coverage of splitTitleString(). Also added
identical parallel tests for Title::makeTitleSafe() to verify that
behavior is the same.

Along the way, I discovered that TitleValue doesn't allow an empty page
name even if there's an interwiki prefix, which is wrong, so I fixed it.

Bug: T220966
Change-Id: I4b915244ceee4c1857178dd68dcdf57f1ee32200

4 years agoUse ExtensionRegistry instead of class name
WMDE-Fisch [Wed, 14 Aug 2019 17:07:39 +0000 (19:07 +0200)]
Use ExtensionRegistry instead of class name

Use the ExtensionRegistry instead of checking for the main class
name of the Cite extension. - I'm not entirely sure if this is much
better. A hook would still be the better option. But at least Cite
could be refactored and the class name changed.

Bug: T89151
Change-Id: I35e5aa9955141b575de68a5be2c0d5b87585eb77

4 years agoMerge "Set @return-taint of Sanitizer::stripAllTags to tainted"
jenkins-bot [Wed, 14 Aug 2019 16:03:02 +0000 (16:03 +0000)]
Merge "Set @return-taint of Sanitizer::stripAllTags to tainted"

4 years agomaintenance/populateChangeTagDef.php: Handle missing valid_tags table
Brad Jorsch [Wed, 14 Aug 2019 15:57:12 +0000 (11:57 -0400)]
maintenance/populateChangeTagDef.php: Handle missing valid_tags table

The valid_tags table was added in MW 1.15 and removed in 1.33. If
someone is trying to upgrade from a really old version of MediaWiki,
valid_tags may not exist even though change_tags.ct_tag does.

Bug: T230317
Change-Id: Ib94542878b8d301c1d7f806405ee39838ebc6d4a

4 years agoMore clean up of oracle/mssql
Amir Sarabadani [Wed, 14 Aug 2019 15:04:50 +0000 (17:04 +0200)]
More clean up of oracle/mssql

Bug: T230418
Change-Id: I1ff01548e55f01f9419668e31d5aa7dd03d23258

4 years agoMerge "Tests: Allow vendor/bin/phpunit from within extension directory"
jenkins-bot [Wed, 14 Aug 2019 14:09:41 +0000 (14:09 +0000)]
Merge "Tests: Allow vendor/bin/phpunit from within extension directory"

4 years agoMerge "DefaultSettings: Document wgTmpDirectory guarantees and expectations"
jenkins-bot [Wed, 14 Aug 2019 12:31:40 +0000 (12:31 +0000)]
Merge "DefaultSettings: Document wgTmpDirectory guarantees and expectations"

4 years agoDrop Oracle and Mssql
Amir Sarabadani [Tue, 13 Aug 2019 17:06:26 +0000 (19:06 +0200)]
Drop Oracle and Mssql

After approval of RFC T191231, we are going to drop oracle and mssql
and it will be possible to bring back the support using the abstract schema

Adding to release notes will be done in a follow-up

Bug: T230418
Change-Id: I90bd5cfcc3e18011b193c965fdb1fa54675040b5

4 years agoTests: Allow vendor/bin/phpunit from within extension directory
Kosta Harlan [Wed, 14 Aug 2019 08:25:01 +0000 (10:25 +0200)]
Tests: Allow vendor/bin/phpunit from within extension directory

Prior to this patch, one could not run this command from within an extension
directory: `../../vendor/bin/phpunit -c ../../phpunit.xml.dist tests/phpunit`,
because our code in bootstrap.php loaded "LocalSettings.php" instead of
$IP/LocalSettings.php.

Note that making this change does not result in loading LocalSettings.php when
running unit tests.

Bug: T87781
Change-Id: Iee8440f11a2bb255567646289a1986d636c12765

4 years agoClear test user registry between tests
Aryeh Gregor [Mon, 12 Aug 2019 17:43:21 +0000 (20:43 +0300)]
Clear test user registry between tests

Otherwise User members will wind up retaining stale references to
services. The more things move to services, the more state we need to
reset between tests to avoid subtle and confusing test failures!

TestUsers can't be created if the DB prefix is not either unittest_ or
ut_, which caused failures in RCFeedIntegrationTest.php with this change
now that it was trying to create a new TestUser. Fix is to set the
prefix to one of those two instead of empty.

Change-Id: I41f87e1acffe94361748ef4ab69c290de587e6be

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 14 Aug 2019 06:23:43 +0000 (08:23 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I6bf6f5827c4cb7527902f380e342bfb1263e83c3

4 years agoSet @return-taint of Sanitizer::stripAllTags to tainted
sbassett [Tue, 13 Aug 2019 22:06:53 +0000 (17:06 -0500)]
Set @return-taint of Sanitizer::stripAllTags to tainted

phan-taint-check (aka SecurityCheckPlugin) doesn't recognize
Sanitizer::stripAllTags' output as tainted in certain situations.
Adding a @return-taint of tainted to ensure that it does, which
may result in the reporting of more issues.

Bug: T230234
Change-Id: I357c168417a26882c7c460df20f36ec2be401096

4 years agoMerge "ApiFeedContributions: Throw if the username is invalid"
jenkins-bot [Tue, 13 Aug 2019 19:53:54 +0000 (19:53 +0000)]
Merge "ApiFeedContributions: Throw if the username is invalid"

4 years agoApiFeedContributions: Throw if the username is invalid
Petr Pchelko [Fri, 9 Aug 2019 20:53:45 +0000 (13:53 -0700)]
ApiFeedContributions: Throw if the username is invalid

Bug: T230239
Change-Id: I4141047c8f1ff73665b79a27a7c5eb995c52ea88

4 years agoMerge "Don't use new MCR schema without using DB"
jenkins-bot [Tue, 13 Aug 2019 15:09:58 +0000 (15:09 +0000)]
Merge "Don't use new MCR schema without using DB"

4 years agoMerge "Allow spaces in TitleValue constructor"
jenkins-bot [Tue, 13 Aug 2019 14:06:47 +0000 (14:06 +0000)]
Merge "Allow spaces in TitleValue constructor"

4 years agoDon't use new MCR schema without using DB
Aryeh Gregor [Tue, 13 Aug 2019 07:55:48 +0000 (10:55 +0300)]
Don't use new MCR schema without using DB

If $wgContentHandlerUseDB is false and
$wgMultiContentRevisionSchemaMigrationStage is not SCHEMA_COMPAT_OLD,
RevisionStoreFactory::getRevisionStore() throws. This is coming up in
some seemingly unrelated code changes, perhaps due to access of stale
service objects, but I'm not sure because I can't reproduce locally. So
this is a shot in the dark to fix it.

Change-Id: Id29a62e1f537fa1b2016aac396773b728e238cda

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 13 Aug 2019 06:26:32 +0000 (08:26 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I71d2db842bf204a483e3c9b4695cbf744bca2cf2

4 years agoFix typos in code
DannyS712 [Tue, 13 Aug 2019 05:49:42 +0000 (05:49 +0000)]
Fix typos in code

Bug: T201491
Change-Id: I4e236ed2dc7a4d0c4aae43167a01e710983d9e27

4 years agoAdd Parser::resetOutput() and getStripState()
Tim Starling [Mon, 12 Aug 2019 06:10:22 +0000 (16:10 +1000)]
Add Parser::resetOutput() and getStripState()

For Parsoid's convenience, add to Parser resetOutput(), getStripState()
and a $revId parameter to startExternalParse().

Parser::resetOutput() allows Parsoid to get the ParserOutput of each
template without resetting the DOM cache.

Change-Id: I084676acdc8db185b8efd9b97b7d5326afd2a997

4 years agoMerge "objectcache: clean up MemcachedBagOStuff expiry handling"
jenkins-bot [Mon, 12 Aug 2019 20:27:40 +0000 (20:27 +0000)]
Merge "objectcache: clean up MemcachedBagOStuff expiry handling"

4 years agoMerge "Add german alias for displaytitle_noerror/_noreplace"
jenkins-bot [Mon, 12 Aug 2019 17:10:37 +0000 (17:10 +0000)]
Merge "Add german alias for displaytitle_noerror/_noreplace"

4 years agoRedirectSpecialArticle: Avoid double redirect for action=edit&redlink=1
Bartosz Dziewoński [Thu, 8 Aug 2019 19:45:04 +0000 (21:45 +0200)]
RedirectSpecialArticle: Avoid double redirect for action=edit&redlink=1

If you visit `Special:MyPage?action=edit&redlink=1` and your user page
exists, this would redirect to `User:Yourname?action=edit&redlink=1`,
which then would redirect further to `User:Yourname`. Just redirect
there directly.

Additionally, the double-redirect seems to somehow conflict with the
fake-redirect code for $wgHideIdentifiableRedirects. I couldn't figure
out why this happens, but you end up on a blank page and no redirect
of either kind occurs.

Bug: T229794
Change-Id: I952fc9df91b1243db22f956ec09bee457c8a21bf

4 years agoAllow spaces in TitleValue constructor
Aryeh Gregor [Tue, 16 Apr 2019 14:33:34 +0000 (17:33 +0300)]
Allow spaces in TitleValue constructor

Change-Id: I809731508036409fda72b271aac8a37f3ac1ef2d

4 years agoAdd german alias for displaytitle_noerror/_noreplace
Umherirrender [Mon, 12 Aug 2019 11:13:57 +0000 (13:13 +0200)]
Add german alias for displaytitle_noerror/_noreplace

Reuse the values from defaultsort_noerror/_noreplace

Change-Id: I8bef5920040d10128d94e5131bd7480e762ca928

4 years agoMerge "Add german alias for special page NewSection"
jenkins-bot [Mon, 12 Aug 2019 09:57:42 +0000 (09:57 +0000)]
Merge "Add german alias for special page NewSection"

4 years agoFix Special:NewSection showNoRedirectPage form handling (3)
DannyS712 [Sat, 10 Aug 2019 23:55:45 +0000 (23:55 +0000)]
Fix Special:NewSection showNoRedirectPage form handling (3)

Handle invalid titles by using `newFromTextThrow` and
returning a fatal status if the title is invalid.

Bug: T207577
Change-Id: I2bdfcdbcb7ee41f96122e7f8aa561f6eee34be7b

4 years agoAdd german alias for special page NewSection
Umherirrender [Mon, 12 Aug 2019 09:21:11 +0000 (11:21 +0200)]
Add german alias for special page NewSection

Change-Id: Ibdd838d53f4b323dce9c1438b7d13e7289ce570f

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 12 Aug 2019 06:20:18 +0000 (08:20 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I60e49dd26845b81e64b20bb386ee23bea73713c1

4 years agoMerge "Inject LoadBalancer into GenderCache"
jenkins-bot [Sat, 10 Aug 2019 23:43:06 +0000 (23:43 +0000)]
Merge "Inject LoadBalancer into GenderCache"

4 years agoobjectcache: clean up MemcachedBagOStuff expiry handling
Aaron Schulz [Thu, 8 Aug 2019 16:38:55 +0000 (09:38 -0700)]
objectcache: clean up MemcachedBagOStuff expiry handling

Partly a follow-up to 88640fd902900.

Use real time in changeTTL() tests to fix all remaining
failures for BagOStuff sub-classes.

Change-Id: I537d665d6c8770a68a5a79233a913f1714881dfb

4 years agoMerge "rdbms: remove DatabaseSqlite::checkForEnabledSearch() in favor of explicit...
jenkins-bot [Sat, 10 Aug 2019 00:54:10 +0000 (00:54 +0000)]
Merge "rdbms: remove DatabaseSqlite::checkForEnabledSearch() in favor of explicit queries"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 9 Aug 2019 06:23:06 +0000 (08:23 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I34b028ec7073f2b146654992d0eff6a221bd1247

4 years agoMerge "resourceloader: Rewrite the minify.php maintenance script"
jenkins-bot [Fri, 9 Aug 2019 03:25:36 +0000 (03:25 +0000)]
Merge "resourceloader: Rewrite the minify.php maintenance script"

4 years agoparser: use 'vary-revision-sha1' in Parser::statelessFetchTemplate
Aaron Schulz [Mon, 29 Jul 2019 14:29:58 +0000 (10:29 -0400)]
parser: use 'vary-revision-sha1' in Parser::statelessFetchTemplate

Bug: T226785
Change-Id: Ib306cdcbc939553ea318612cb5273d6b77c5e21c