Commit graph

103603 commits

Author SHA1 Message Date
DannyS712
abb55334ac Simplify and cleanup TalkPageNotificationManagerTest
Instead of depending on full User objects, accept
UserIdentity(Value), we only needed User::getTalkPage
but that is trivial to recreate with UserIdentity.
By switching to UserIdentityValue objects, we can specify
the user id easily and not need to load from the database.
Also, give the anonymous user an ip address for the name.

Use a data provider for doTestUserHasNewMessages

Change-Id: I4d1d0226aeee154db42a31b56873e428cd46b64f
2021-05-12 21:15:26 +00:00
jenkins-bot
dcfcd708de Merge "GetAllBlockActionsHook: Document avoiding blockable action ID conflicts" 2021-05-10 18:39:50 +00:00
jenkins-bot
e56ca63098 Merge "IntegrationTestCase: Fix incomplete error message" 2021-05-10 17:53:23 +00:00
jenkins-bot
bb0c0d446f Merge "Remove hard deprecated methods from ApiBase" 2021-05-10 17:47:45 +00:00
jenkins-bot
9d3c293058 Merge "MediaSearch: Remove obsolete vendor prefixes" 2021-05-10 17:47:39 +00:00
Thalia
d85a4124e2 GetAllBlockActionsHook: Document avoiding blockable action ID conflicts
Change-Id: I2975d646f44a5dc1443d22a685565f14fdee614d
2021-05-10 18:35:58 +01:00
jenkins-bot
4d284420e4 Merge "ApiBase: deduplicate logic to avoid infinite loops for ApiMain methods" 2021-05-10 17:25:37 +00:00
jenkins-bot
334dfff732 Merge "User: Hard-deprecate the confusingly-named isLoggedIn() method" 2021-05-10 16:52:21 +00:00
jenkins-bot
2ff99a440a Merge "User::getID: Be lazier when fetching UserNameUtils" 2021-05-10 16:52:13 +00:00
Ammarpad
d90bff177f IntegrationTestCase: Fix incomplete error message
Change-Id: Id5bee445b67cf5339b0e3d7bb4376fb114312a06
2021-05-10 15:34:55 +01:00
James D. Forrester
6bbad15444 User: Hard-deprecate the confusingly-named isLoggedIn() method
This was soft-deprecated in 0171846c, since when all uses in Wikimedia
production code have been removed. As this is such a vital and widely-
used method, we'll want to deprecate it for at least two releases. and
so we should get this in at a time when we're willing to fix many such
uses. Why not now?

Bug: T270450
Change-Id: I8ac4a91d77c2bb748183b69b3e901cce93cbc940
2021-05-10 07:30:23 -07:00
jenkins-bot
a19532464d Merge "PageIdentityValue: apply basic validation of titles" 2021-05-10 14:11:39 +00:00
jenkins-bot
7d2920c842 Merge "LogPager: replace Title in method signatures" 2021-05-10 13:54:46 +00:00
jenkins-bot
fafcddb009 Merge "HTMLForm: accept PageReference instead of Title." 2021-05-10 13:49:31 +00:00
jenkins-bot
3d7868059d Merge "RevisionDeleter: Use PageIdentity instead of Title" 2021-05-10 13:41:25 +00:00
Gergő Tisza
2e7856a67c User::getID: Be lazier when fetching UserNameUtils
Given that User::getID is a very common method, used very early
during setup (e.g. during session initialization), only load
its dependency when it's really needed.

Bug: T282320
Change-Id: I6565426e9bf7084b1a33d39b2882639a03210460
2021-05-10 15:26:24 +02:00
jenkins-bot
b6fea99341 Merge "DatabaseBlockStore: fetch correct ActorNormalization" 2021-05-10 09:13:12 +00:00
jenkins-bot
7abcde069b Merge "Run tests with ONLY_FULL_GROUP_BY" 2021-05-10 08:12:57 +00:00
Translation updater bot
79bd45e8c7 Localisation updates from https://translatewiki.net.
Change-Id: I10cd64bcebfc0885a2071fbbbe7ab1383f82c1a4
2021-05-10 08:49:07 +02:00
jenkins-bot
e4c260496a Merge "RequestContext: add @param documentation to setAuthority()" 2021-05-10 05:59:54 +00:00
jenkins-bot
9c3aa308a7 Merge "Update OOjs from v5.0.0 to v6.0.0" 2021-05-10 00:30:42 +00:00
Universal Omega
bed2c33c7b RequestContext: add @param documentation to setAuthority()
Change-Id: I78caeb1d76aebcf3e8c6ba48128078a0bbec520c
2021-05-09 23:18:48 +00:00
jenkins-bot
d55e11258e Merge "Simplify database handling in CategoryTest" 2021-05-09 18:45:46 +00:00
DannyS712
2192f54a23 Remove hard deprecated methods from ApiBase
* ::explodeMultiValue
* ::parseMultiValue
* ::validateLimit
* ::validateTimestamp

Change-Id: I326abedc01d7096e67e193c7967b107e253b8916
2021-05-09 02:00:42 +00:00
DannyS712
96b99076e6 ApiBase: deduplicate logic to avoid infinite loops for ApiMain methods
Add private helper ApiBase::dieIfMain()

Change-Id: I3d9881356bd66447e67ccccf20697f4b88885854
2021-05-09 01:45:40 +00:00
DannyS712
d2a0b3976c Simplify database handling in CategoryTest
Use addDBData() and tables used

Change-Id: Ib9c9e9dcd2ddfad4ab9d4780c44fbc94a7a85d77
2021-05-09 00:53:31 +00:00
James D. Forrester
d13b4678a6 DatabaseBlock: Hard-deprecate calls to isWhitelistedFromAutoblocks()
Bug: T277987
Change-Id: Ic14f38e0e60bd156d1ff04392e65eeceb3ba77b2
2021-05-08 11:40:56 -07:00
James D. Forrester
f121d0fbde DatabaseBlock::isExemptedFromAutoblocks: Drop fallback message load
This is no longer needed in Wikimedia production. Third
party users will have had a release to adjust to one of
the three called-out migration issues. It's time.

Bug: T277987
Change-Id: Ia4a797afc71441ed9a7a90ff4f1e72cc4495cf63
2021-05-08 11:39:28 -07:00
jenkins-bot
c1d1d65d6c Merge "resourceloader: Fix path-only URLs in wiki modules when script path is docroot" 2021-05-08 17:21:07 +00:00
jenkins-bot
397752a0d2 Merge "Update wikimedia/minify to 2.2.2" 2021-05-08 17:18:58 +00:00
jenkins-bot
234103c2e7 Merge "Rename page_timestamp revision index" 2021-05-08 08:27:51 +00:00
jenkins-bot
fc9c300567 Merge "Do not call SpecialPage::addHelpLink in constructor" 2021-05-08 07:49:04 +00:00
jenkins-bot
32d1ce99a7 Merge "registration: Allow multi-line strings in "@" note keys" 2021-05-08 05:13:42 +00:00
Timo Tijhof
321f85580b resourceloader: Fix path-only URLs in wiki modules when script path is docroot
When a wiki is installed with its script path as the document root,
then WikiModule would pass MediaWiki's wgScriptPath value (empty string)
to CSSMin as base url, which is invalid.

A similar bug was recently fixed in FileModule with I16abf482e3a1a.

Bug: T282280
Change-Id: I0b9a67aa912eb3a0320631027303cedf3f348bb8
2021-05-08 00:27:50 +01:00
Timo Tijhof
7fef1bea61 Update wikimedia/minify to 2.2.2
Bug: T282280
Depends-On: I1d2f958a7a3c594e020bb19c5284b3dbe69d7ebd
Change-Id: I759c47f87e47c27bba479b4e4f10e53d2c722e8c
2021-05-08 00:27:50 +01:00
daniel
39a6e11310 HTMLForm: accept PageReference instead of Title.
Note that this changes the effective type of the protected mCancelTarget
field. This fields has no declared type, and does not seem to be used in
any subclass. The type of mTitle is not changed at this time, but
nothing seems to rely on that either.

Bug: T278459
Change-Id: I4bf0d46c74b53ffc9cb3e6e497c789ef6b3bab6a
2021-05-07 23:36:49 +02:00
jenkins-bot
41d7fa917f Merge "Split TimeCorrection parser into separate class" 2021-05-07 18:43:08 +00:00
Derk-Jan Hartman
65c955746c Split TimeCorrection parser into separate class
The parsing of the timecorrection useroption was split over multiple
classes. Combine into a single class and add some testcases.

Change-Id: I2cadac00e46dff2bc7d81ac2f294ea2ae4e72f47
2021-05-07 10:43:09 -07:00
jenkins-bot
b6744c24fb Merge "ForkController: Throw more meaningful error for missing PHP extensions" 2021-05-07 16:54:46 +00:00
jenkins-bot
2c10c568d4 Merge "Declare $wgCanonicalNamespaceNames in DefaultSettings.php" 2021-05-07 16:15:42 +00:00
jenkins-bot
8ff25e40bb Merge "LinkBatch: skip bad input" 2021-05-07 16:15:04 +00:00
daniel
62176bec1b PageIdentityValue: apply basic validation of titles
In order to prevent bad titles from entering the database,
PageIdentityValue should not allow instances that have obviously broken
dbeys, just like it does not allow construction for a special page.

Note however that for now, we allow PageReferenceValue to represent
thigns that are not actual pages, such as titles like "User:#1234" which
are used in the block log to represent autoblock targets. Similarly,
a PageReferenceValue can represent a special page.

This patch introduces a convenience method for constructing
PageIdentityValues in a context where it is uncertain whetehr the title
is valid, providing an opportunity to the caller to report in which
context the bad values were found.

In addition, this patch adds some documentation and testing, to clarify
the semantics of methods in PageStore with respect to invalid and non-
proper titles.

Bug: T282070
Change-Id: I8a44d9e73dda8fe38d009847332946809767d0fa
2021-05-07 17:17:45 +02:00
daniel
60734d3b19 LogPager: replace Title in method signatures
Bug: T278459
Change-Id: Icd273b598fefe5e5d18aef4e4d12adfbf88e291a
2021-05-07 17:12:23 +02:00
daniel
316053ed88 LinkBatch: skip bad input
LinkBatch used to be lenient about receiving null or invalid titles.
This patch restores this lenient behavior.

Bug: T282180
Bug: T282070
Change-Id: I2c6378a3a0d508c77bcb290a6ed07f4d5f96d62c
2021-05-07 16:22:24 +02:00
daniel
c22695e5e7 Declare $wgCanonicalNamespaceNames in DefaultSettings.php
This ensures tests can run from phpstorm directly, without MediaWiki's
custom phpunit wrapper.

Background:
$wgCanonicalNamespaceNames needs to be declared in DefaultSettings so
it works properly when Setup.php is included via
wfRequireOnceInGlobalScope, as is the case in
MediaWikiIntegrationTestCase::initializeForStandardPhpunitEntrypointIfNeeded.

wfRequireOnceInGlobalScope will import any variables in the global scope
into the local scope to make them available in the included file. It
also exports all variables declared in the scope of the included file to
the global scope, but only after the file includsion returns.

If $wgCanonicalNamespaceNames is not defined in global scope before
Setup.php runs, then the $wgCanonicalNamespaceNames variable defined in
Setup.php will not become global until after Setup.php finishes.
However, Setup.php instantiates services that need
$wgCanonicalNamespaceNames to be present. This causes the test framework
to fail.

Change-Id: I8c5179433737170303f37cb072cb0352006ca173
2021-05-07 16:10:48 +02:00
jenkins-bot
56432869e3 Merge "Add null checks for namespaces and actions in blocks" 2021-05-07 13:41:27 +00:00
STran
ee877f2f10 Add null checks for namespaces and actions in blocks
Don't show namespaces or actions that are not active (eg. uninstalled
extension) in block information

Bug: T280798
Change-Id: I14fa7006b3d46eeb41d53216c5203d294fff6338
2021-05-07 04:20:58 -07:00
jenkins-bot
b345fe0218 Merge "Stop resetting partial action block options when values change" 2021-05-07 10:56:57 +00:00
daniel
1823345c52 Title: avoid instance cache pollution
Bug: T281337
Change-Id: I2e8d18b2fc10509097f66287b2543217f4eb9b6a
2021-05-07 11:37:54 +02:00
Translation updater bot
cd8d97368f Localisation updates from https://translatewiki.net.
Change-Id: I9bc1cdefed392f541d9ff05d273e14f000debc68
2021-05-07 08:39:20 +02:00