Commit graph

111010 commits

Author SHA1 Message Date
Reedy
dee3ed327a Upgrading wikimedia/php-session-serializer (v2.0.0 => v2.0.1)
Bug: T287972
Change-Id: I0b72c69faec8a194ced8e0da6a18b3db77daebcd
Depends-On: Id83f7612ec5c7851a7f8fb1f0e55737b31c6c35b
2022-07-08 23:35:30 +01:00
Reedy
65222bd67e Upgrading wikimedia/base-convert (v2.0.1 => v2.0.2)
Bug: T287972
Change-Id: I8458f98ec4b47369d53e8d2a42fb0cd24461b24c
Depends-On: Ib90bff33eaa15714bcc6659456ab0c24cf13e71d
2022-07-08 23:32:13 +01:00
jenkins-bot
2bf4400740 Merge "Parser::extensionSubstitution() Don't run substr() on null" 2022-07-08 19:17:00 +00:00
jenkins-bot
ad76b3a666 Merge "permission: Simplify @covers annotations in PermissionManagerTest" 2022-07-08 19:06:33 +00:00
Reedy
5d2feb1da1 Parser::extensionSubstitution() Don't run substr() on null
extensionSubstitution returns a string, not null,
so if $params['attr'] is not set, default to using
an empty string (''), not null.

Bug: T312519
Bug: T312520
Change-Id: I566d95a32cffe1ef20f18ae9d9af96d57e0823a9
2022-07-08 18:54:22 +00:00
Reedy
c016da960a HISTORY: Add 1.37.4
Change-Id: I6c0084dc71d0ab90adb9e7997c469890bd222f52
2022-07-08 18:43:28 +01:00
jenkins-bot
1eedcf0db8 Merge "MediaWiki.php: Reduce scope of variables" 2022-07-08 16:28:30 +00:00
jenkins-bot
f5ba3b2e8e Merge "Remove deprecated wfGetScriptUrl" 2022-07-08 15:27:10 +00:00
jenkins-bot
54583e98b3 Merge "Remove deprecated wfLocalFile and wfFindFile" 2022-07-08 15:26:29 +00:00
Matěj Suchánek
99aad54ea8 Hard deprecate FormatMetadata::flattenArrayContentLang
It has been deprecated since 1.36 and it is unused.

Change-Id: I316333f55526116e9510e4719fce2a93e7683ea6
2022-07-08 07:01:10 +00:00
Matěj Suchánek
3378c95852 Hard deprecate DifferenceEngine::textDiff
It has been deprecated since 1.32 and it is unused.

Change-Id: Icca017deb30dfc335f56ebc1ab2e6522c64e64af
2022-07-08 07:01:05 +00:00
Matěj Suchánek
7f79eacb04 Hard deprecate WikiRevision::downloadSource
It has been deprecated since 1.31 and it is unused.

Change-Id: Ieb2273939fa5d4244ccf1fd4a653ec784167dfe1
2022-07-08 07:00:54 +00:00
Matěj Suchánek
e209f9a7e0 Hard deprecate ManualLogEntry::setTags
It has been deprecated since 1.33 and it is unused
in Wikimedia code.

Change-Id: I010614d600b1ec334b92cc1a8897a10756504a69
2022-07-08 07:00:44 +00:00
Matěj Suchánek
a6fe660504 Hard deprecate IContextSource::getStats() implementations
They have been deprecated since 1.27.

Depends-On: I82abb695f30a8c3869dfa620483a9168dbf49fa1
Depends-On: I3da32e6620f2213b50e0e366884c47188208acc1
Change-Id: I49d95873b18261954b0c50ff551f4b1ea9a5fbdf
2022-07-08 09:00:09 +02:00
Translation updater bot
2b6bb61708 Localisation updates from https://translatewiki.net.
Change-Id: I708937c29ddf7eafe2cb72409cf26149461e5720
2022-07-08 08:23:21 +02:00
jenkins-bot
766374ba4a Merge "ResourceLoader: Switch Image.php to injected log channel" 2022-07-08 04:15:50 +00:00
Timo Tijhof
9a0cb0940b ResourceLoader: Switch Image.php to injected log channel
Avoid having to look at and query multiple channels for the same
core component. Use different log levels and messages instead.

E.g. avoid Foo and FooError or FooBar, use only "Foo".

This also switched to the injected Logger object at the same time.
This also avoids global wfDebugLog() at the same time.

Bug: T32956
Change-Id: I3e43b10d26858c5b3851476c8bbd27282316dd32
2022-07-08 03:57:16 +00:00
jenkins-bot
386005e093 Merge "rdbms: Add a note encouraging use of SelectQueryBuilder in IDatabase::select" 2022-07-08 01:47:38 +00:00
Timo Tijhof
2721c7a1d8 permission: Simplify @covers annotations in PermissionManagerTest
Also remove an unused variable, and convert one provider to generator.

Change-Id: I63e506f30ae334ceff9658c595e64a7e9ada5bbd
2022-07-07 18:22:13 -07:00
Umherirrender
338cd0fc6a MediaWiki.php: Reduce scope of variables
Some variables are set before early returns but used after - move that
Some variables are set before an if, but only used inside the if - move
the variables inside the if to skip the init of the variable

Change-Id: I1da72bc7fae44316162ab96672fd6745e65341fc
2022-07-08 01:41:46 +02:00
jenkins-bot
0707d2f4ca Merge "MediaWiki: Avoid spurious page query" 2022-07-07 22:43:36 +00:00
jenkins-bot
2ded4c3470 Merge "Fix typing of MessageCacheReplaceHook" 2022-07-07 22:05:57 +00:00
jenkins-bot
4255947f58 Merge "Do not use FormSpecialPage::{pre,post}Text" 2022-07-07 20:42:35 +00:00
Martin Urbanec
2173e17632 Do not use FormSpecialPage::{pre,post}Text
Soft-deprecated since 1.38.

Bug: T312579
Change-Id: I80ceb565cd3691756d4f848f9df5d9b8c589b161
2022-07-07 21:27:18 +02:00
Umherirrender
51f9040be4 Remove deprecated wfLocalFile and wfFindFile
Bug: T249020
Change-Id: I9988e0abcec39ec0c6e92a92d40363a45483f016
2022-07-07 18:49:31 +00:00
Umherirrender
0c77580f7e Deprecate unused wfQueriesMustScale
Change-Id: Ic2971c31f29babb48fb211b600a79876351ababb
2022-07-07 18:42:12 +00:00
Umherirrender
ba9f124cd3 Remove deprecated wfGetScriptUrl
Change-Id: I856f390b5329e06e9d7047ee980cc49813b11e00
2022-07-07 20:35:01 +02:00
jenkins-bot
7f0484c737 Merge "Language::getHumanTimestamp: Don't show time when timestamp in a different year" 2022-07-07 17:12:40 +00:00
C. Scott Ananian
577879841c ParserOutput::mergeMapStrategy: don't crash if merging non-array values
The PHP `isset(...)` construct covers a multitude of possible "wrong
types" for the left hand side of an array access, but it still crashes
(with "Cannot use object of type stdClass as array") if the left hand
side is an object.

Bug: T312242
Change-Id: I35026c573fb941004764d46d5652ebcddc559c03
2022-07-07 15:02:57 +00:00
Máté Szabó
0a55543f22 Fix typing of MessageCacheReplaceHook
MessageCacheReplaceHook claims that the $title parameter will be a
Title instance, but refreshAndReplaceInternal() passes a string.
Update the hook documentation to match the actual behavior.

Change-Id: Ia4ab8a21c40fc7d3b4a15ab3bdef3065601fea5c
2022-07-07 14:40:22 +02:00
Amir Sarabadani
9bb7c5dcc6 rdbms: Add a note encouraging use of SelectQueryBuilder in IDatabase::select
And similar methods such as selectRowCount.

Until I340ad4144c31 is unblocked.

Bug: T243051
Bug: T311866
Bug: T259518
Change-Id: Ic0e757a8e23aba16d8e273e4326276f659603c9e
2022-07-07 14:36:53 +02:00
jenkins-bot
52bf11384c Merge "Category: Migrate to use SelectQueryBuilder in ::getMembers" 2022-07-07 08:16:25 +00:00
Amir Sarabadani
0dc97853c2 Category: Migrate to use SelectQueryBuilder in ::getMembers
Bug: T311866
Change-Id: I9c8af732eaebce46d5e136d674c0930dafacfab2
2022-07-07 07:50:43 +00:00
daniel
c6c62e2c8f PHPUnit: enable main object cache in tests
This sets MainCacheType to 'hash', so the main cache is functional
within test cases. Between tests we are already calling ObjectCache::clear,
so the cache will not leak data into other test cases.

It turned out that the way we have been overriding configuration
settings in MediaWikiIntegrationTestCase is insufficient, since the
overrides would only apply in the main Config object, not in global
variables. This means they could not be overwritten with setMwGlobals.
So this patch also changes how we apply config overrides for test setup.

Config overrides that happen during tests work as before.

Depends-On: Ic36e92b73f22fd64e2d0b680d8e900f598158460
Change-Id: Ia60cb0bc18b235f23d9778da8241f65accfc0d35
2022-07-07 16:26:03 +10:00
daniel
bf092744c9 PHPUnit: introduce setMainCache
The main object cache is disabled during testing. Some integration tests
need it though. This provides a clean way to enable it, to replace the hacks
that were used so far.

Note that we may want to enable the main cache during testing soon. When
that happens, this method is still useful to disable the cache in certain
tests, and to set a specific cache instance.

Change-Id: I04ae1bf1b6b2c8f6310acd2edf89459d01a9c870
2022-07-07 16:25:59 +10:00
Translation updater bot
c3d4646763 Localisation updates from https://translatewiki.net.
Change-Id: I03c2105032731dd958314266184ed8458816ee16
2022-07-07 08:19:54 +02:00
jenkins-bot
015f0c6fef Merge "Move rate limiting tests into RaterLimiterTest" 2022-07-07 05:27:27 +00:00
jenkins-bot
0f75ef7180 Merge "Use HashConfig to override config variables in phpunit tests" 2022-07-07 05:13:52 +00:00
daniel
ac7138d45b Use HashConfig to override config variables in phpunit tests
This implements config overrides with a HashConfig that is layered on
top of the base config, so we can move away from global variables.

Global variables are still updated using setMwGlobals, for compatibility
with code that is still reading configuration from global variables.

This fixes an issue with the default overrides not being applied to
global variables.

Change-Id: I1922d9b903dcafb83691c2d96790f72747eeef9c
2022-07-07 14:54:06 +10:00
Aryeh Gregor
b72b9a8c43 Move dynamic defaults into MainConfigSchema
The goal is to keep the actual default values for settings in the same
place as the setting is declared, and applied using the regular means
for loading the settings -- not in a separate piece of code that needs
to be loaded through some entirely different mechanism.

SetupDynamicConfig.php now contains a few categories of things:

* Post-processing of configuration settings, where already-set settings
  are altered. This could be moved to MainConfigSchema too as a separate
  set of methods.
* Processing of old aliases of settings (blacklist, slave) that are not
  registered as settings anymore and therefore are not available to
  MainConfigSchema. This could perhaps be moved to LocalSettings
  processing somehow?
* Setting $wgUseEnotif, which is also not registered as a setting.
  Easiest would be just to declare it as a setting and have it set
  unconditionally.
* Setting the actual timezone to $wgLocaltimezone. This is not related
  to configuration and should just be in Setup.php.

Bug: T305093
Change-Id: Ia5c23b52dbbfcb3d07ffcf5d3b7f2d7befba2a26
2022-07-07 09:55:48 +10:00
jenkins-bot
14d324c15f Merge "Add new ContentHandler::supportsPreloadContent() feature" 2022-07-06 22:38:10 +00:00
Thiemo Kreuz
6de15c17c1 Add new ContentHandler::supportsPreloadContent() feature
Enable it for JSON content.

Bug: T300644
Change-Id: Ia5c491cd856ca395fb431bcefd63026084b01a99
2022-07-06 22:19:32 +00:00
Ed Sanders
ae18f66d66 Language::getHumanTimestamp: Don't show time when timestamp in a different year
We don't show the time for timestamps that are more than 5 days old
elsewhere in this function, so we shouldn't start showing them again
for timestamps in another year.

Keep the full timestamp format for timestamps in the future, with the
TODO to improve it.

Improve comments throughout the function to be more accurate.

Bug: T133468
Change-Id: I68c6105cc83ca12e0a8f41e8b611bf4b8f35cd87
2022-07-06 22:25:30 +01:00
jenkins-bot
f8fbafbc80 Merge "rdbms: Adapt hasOrMadeRecentPrimaryChanges test mock for PHP 8.1" 2022-07-06 19:56:35 +00:00
jenkins-bot
ac7022bea6 Merge "GitInfo: simplify and prepare for converting to a service" 2022-07-06 19:56:27 +00:00
jenkins-bot
c5fccae2ff Merge "Remove SpecialUnblock::processUnblock" 2022-07-06 19:43:19 +00:00
Mark A. Hershberger
ea80f07d2f rdbms: Adapt hasOrMadeRecentPrimaryChanges test mock for PHP 8.1
Use a single callback for both mocks.  This is needed because using
PHP 8.1 results in:

> 1) LBFactoryTest::testChronologyProtector
> Implicit conversion from float 1657063075.187724
> to int loses precision
>
> tests/phpunit/includes/db/LBFactoryTest.php:313
> includes/libs/rdbms/ChronologyProtector.php:290

Bug: T312183
Change-Id: I2764cf9b81b08832c904bf7245bd54ca0f0eddad
2022-07-06 19:35:01 +00:00
Mark A. Hershberger
d758eb86c2 filebackend,jobqueue: Add signature for FilterIterator::accept()
MappedIterator is primarily used by JobQueue.

Bug: T307304
Bug: T289879
Change-Id: Idf8ea28d4b6dc4b9d16cf86d3e5f236ad5ee64ae
2022-07-06 19:24:59 +00:00
Mark A. Hershberger
c8586c88dc site: Consistently return null from Site::getDomain()
Note that null triggers the following for php 8.1:

    PHP Deprecated:  strrev(): Passing null to parameter #1 ($string) of
    type string is deprecated

Got a few of these in WikiMapTest::testMakeForeignLink(), caused by a
single call in DBSiteStore.

Bug: T289926
Change-Id: I0b29963ec0e2e8a38a66e250e81fbc16e42465ab
2022-07-06 19:07:01 +00:00
jenkins-bot
6b3afa8ca3 Merge "Merge away mediawiki.ForeignStructuredUpload module" 2022-07-06 18:49:47 +00:00