Commit graph

110946 commits

Author SHA1 Message Date
Lucas Werkmeister
1b1888a533 Revert "objectcache: avoid using heavily time-drifted microtime() values in WAN cache"
I think this is no longer necessary since PHP commit 65067dff01 [1],
first included in PHP 7.2.21, 7.3.8, and in 7.4 since the beginning of
that series. That commit fixed the discrepancy between time() and
microtime() by making time() use gettimeofday() like microtime() already
did (and still does).

The PHP requirement in composer.json is tweaked to ensure no PHP 7.3
version without the fix is used; note that supported release branches
already require >=7.3.19, and the 7.2 requirement is unchanged.

This reverts commit d2c2bf6553.

[1]: 65067dff01

Change-Id: I8bfe0dceb809d0f63a2e9cc767ace9235d5f5246
2022-07-06 12:52:41 +02:00
Translation updater bot
82a43c4c8f Localisation updates from https://translatewiki.net.
Change-Id: I60bc059dfd2bd4fcf64c11fd6d653f06ca222024
2022-07-06 10:05:33 +02:00
jenkins-bot
4ba70b1c3e Merge "Stop merging LinkCache select fields with page_title and page_namespace" 2022-07-06 07:20:36 +00:00
jenkins-bot
af82ebc1bf Merge "tests: Use Title::makeTitle instead of Title::newFromText" 2022-07-06 05:51:43 +00:00
jenkins-bot
95065f70a5 Merge "SpecialRecentChangesLinked: Migrate partially to SelectQueryBuilder" 2022-07-05 22:56:22 +00:00
Umherirrender
047c184bfe tests: Use Title::makeTitle instead of Title::newFromText
Avoid parsing known titles in tests to improve performance

Change-Id: Ibfccfe696f0b8bfda0b99abae324e60bbecef7d8
2022-07-06 00:44:00 +02:00
Alexander Vorwerk
8846700ef0 Stop merging LinkCache select fields with page_title and page_namespace
LinkCache::getSelectFields() includes page_title and page_namespace
since If77c2f9879d7bae71eb59944efd8b3798d16aa46, so we don't need
to add those two specifically.

Change-Id: I8fa9d563af3f9da90fb96369dab0ee5bde860081
2022-07-05 22:28:53 +00:00
jenkins-bot
fa69b9ad87 Merge "Hard deprecate access to WikiRevision::$fileIsTemp" 2022-07-05 21:42:13 +00:00
jenkins-bot
8ce7ab0d6a Merge "Hard deprecate DifferenceEngine::getDiffBodyCacheKey" 2022-07-05 21:42:06 +00:00
Matěj Suchánek
af0bb1a9be Hard deprecate access to WikiRevision::$fileIsTemp
The property has been deprecated since 1.29.

Change-Id: I04ab2fc7aac85f448ebef3bb5bc24aa5c617f233
2022-07-05 20:52:04 +02:00
Matěj Suchánek
07a9769501 Hard deprecate DifferenceEngine::getDiffBodyCacheKey
It has been deprecated since 1.31 and it is unused.

Change-Id: I44bc12e484b4d8ebf362c5ed3ed6052e70016453
2022-07-05 20:33:51 +02:00
Moh'd Khier Abualruz
b42a64f3a5 Deprecate SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation hooks in favor of SkinTemplateNavigation::Universal
Bug: T255319
Change-Id: Iedc97f86095bfbbf899932649f3abbb62230bbaf
2022-07-05 16:57:57 +00:00
jenkins-bot
2ed109aca6 Merge "FormatMetadata: PHP Notice: Array to string conversion" 2022-07-05 15:29:06 +00:00
Mark Shenouda
d4e3a74e9e FormatMetadata: PHP Notice: Array to string conversion
[x] Logging more data when it happens again

Bug: T297403
Change-Id: I4bf2f4204e990b2869c497ffd3a79af7cde34434
2022-07-05 17:09:15 +02:00
Lucas Werkmeister
9e95539fc9 Fix config type of SessionProviders
Bug: T307769
Change-Id: I88754b52c2fa69b6777ce6bee3825bfe97394e48
2022-07-05 15:42:35 +02:00
Lucas Werkmeister
c1a0f9ecb8 Use SelectQueryBuilder in OutputPage
This makes the LEFT JOIN and the WHERE conditions somewhat more
readable, IMHO.

Bug: T311866
Change-Id: I76ef805530187ae9958b5a0fd8e5cda20eb969c6
2022-07-05 13:59:51 +02:00
jenkins-bot
f08bdf9470 Merge "Mark WordLevelDiff as newable for now" 2022-07-05 09:15:42 +00:00
jenkins-bot
5d151b6ce0 Merge "Migrate risky callers of MediaWikiServices::getParser()" 2022-07-05 04:57:36 +00:00
jenkins-bot
cfeaddacc7 Merge "Deprecate Parser::getFreshParser()" 2022-07-05 04:53:47 +00:00
Tim Starling
e2c26e1774 Migrate risky callers of MediaWikiServices::getParser()
Don't call MediaWikiServices::getParser() from ContentHandler.
Always use ParserFactory::getInstance().

Bug: T310948
Change-Id: I5fcdc28111e0c5c7d4a76e69b3978402433ebad9
2022-07-05 14:09:36 +10:00
Tim Starling
f270881ca2 Deprecate Parser::getFreshParser()
Following up on the comment I made at Ibbc1423166f4804a5122, make Parser
instance management a ParserFactory responsibility. It is weird for
Parser to have a ParserFactory proxy aspect.

* Add ParserFactory::getMainInstance(), which is equivalent to the old
  MediaWikiServices::getParser() and $wgParser.
* Add ParserFactory::getInstance(), which is equivalent to
  $wgParser->getFreshInstance(), returning the main instance if it is
  free, or a new instance otherwise. The naming is supposed to encourage
  it as the default way to get a parser, which will help with the linked
  bug.
* Deprecate Parser::getFreshParser() and migrate all core callers.

I left the entry in ServiceWiring.php so that it's not immediately
necessary to migrate ObjectFactory specs that ask for Parser.

Bug: T310948
Change-Id: I762b191e978c2d1bbc9f332c9cfa047888ce2e67
2022-07-05 14:09:36 +10:00
jenkins-bot
1f00a8beef Merge "Clarify handling of verifier headers in POST and PUT" 2022-07-05 04:01:04 +00:00
daniel
aad4f8719a Clarify handling of verifier headers in POST and PUT
Besides being used for caching of the responses of GET requests,
the ETag and Last-Modified headers can be used with PUT and POST
requests to control the conditional execution of requests using
the If-Match and If-Unmodified-Since headers.

For that reason it is important to distinguish between the ETag and
modification date of a resource at the time a request is received
(before the resource is modified), and at the time the response is
being sent (after the resource has been modified). The before-state
is used to check conditionals, while the after-state can be sent back
to the client in the response.

For a GET request, it is reasonable to re-use the ETag and Last-Modified
values that were used to check conditionals in the response.
For PUT and POST, that would generally be wrong, since the resource has
since changed.

Bug: T311819
Change-Id: I1a09b0ef35ae2365e0b261fb5295003aec1f5b17
2022-07-05 03:38:45 +00:00
Tim Starling
bcbfc9ccfc Introduce new WRStats library for write-read stats
A library for storage of counter value time series statistics, based
around the observation that memcached getMulti() is apparently fast
enough to do this in a simple manner, with incremented values stored
in time window buckets.

Bug: T310662
Change-Id: I26b1cdba0a06ad16ad8bb71b455e1b6180924d17
2022-07-05 10:35:19 +10:00
jenkins-bot
7718e09729 Merge "objectcache: Optimise SqlBagOStuff::incrWithInit with WRITE_BACKGROUND" 2022-07-04 23:01:46 +00:00
Tim Starling
79afc20506 objectcache: Optimise SqlBagOStuff::incrWithInit with WRITE_BACKGROUND
Bug: T310662
Bug: T261744
Change-Id: I9549722ff6f0c4d62d1bcbe8de55f51758157ec4
2022-07-04 22:43:45 +00:00
jenkins-bot
efa04a9320 Merge "ParsoidHandler: fix redirect target URLs." 2022-07-04 15:48:35 +00:00
dwalden
c5dbcae238 Correct doc for isIPv6Address which incorrectly uses "isIPv4Address".
Change-Id: I9ec48a9715848fade0f8ee2734e46ffec6774d93
2022-07-04 15:24:59 +01:00
daniel
8788600e43 ParsoidHandler: fix redirect target URLs.
This is a temporary workaround for T311867, to allow the private parsoid
extension endpoints to redirect to each other.

It restores the code as it is in the parsoid extension's version of
this method.

Bug: T311867
Change-Id: I387388aae5453105779f4dfc5089d43ae774ab16
Needed-By: I7a13d43510eb7e044de74019d4c6f7d57072b2e1
2022-07-04 13:10:09 +00:00
Translation updater bot
9d7f485011 Localisation updates from https://translatewiki.net.
Change-Id: I73b5f16b4b0e2392aa8fd9fea97ff2b5453d5f88
2022-07-04 08:06:43 +02:00
jenkins-bot
ab0333d29a Merge "Add Campidanese Sardinian (sro) to Names.php" 2022-07-03 19:58:24 +00:00
jenkins-bot
e6b14d5f8c Merge "Remove index detection 'rev_page_timestamp'" 2022-07-03 17:27:35 +00:00
jenkins-bot
535b88470c Merge "specialpage: Fix deprecation for QueryPage::getSQL" 2022-07-03 17:18:03 +00:00
jenkins-bot
762cc0acab Merge "SpecialWithoutInterwiki: Don't pass null through to Title::capitalize()" 2022-07-03 00:23:12 +00:00
jenkins-bot
35c908aaf3 Merge "SpecialLinkSearch: Don't pass null through to the parser" 2022-07-03 00:22:57 +00:00
jenkins-bot
03e9c864ff Merge "tests: Expand DerivativeContextTest" 2022-07-03 00:21:20 +00:00
dreamyjazz
de9d6eb84e Fire a change event on the checkboxes when selecting All/None/Invert
Fire a change event through JQuery when the user selects one of
All / Invert / None when using the list toggle provided in
ListToggle.php so that any JS that listens for a change event on
the checkboxes (that would be for the user selecting or de-
selecting checkboxes) gets a change event.

This is needed because CheckUser's caMultiLock.js script listens
for change events on the checkboxes in the 'Get edits' results
to update the URL that links to the MultiLock special page.

Bug: T311924
Change-Id: I76af8f2bbd6707dacef9872bb5a737823fc3d0af
2022-07-02 20:21:01 +01:00
Reedy
237091d3e5 SpecialWithoutInterwiki: Don't pass null through to Title::capitalize()
Bug: T311570
Change-Id: I160426192354c0e94f14081ffe03e94c1fc9513c
2022-07-02 18:41:20 +00:00
Reedy
0e3018e49f SpecialLinkSearch: Don't pass null through to the parser
Bug: T311574
Bug: T311576
Change-Id: Ic766a1387c1a327b63b12c4bd587992fb8597e36
2022-07-02 19:29:09 +01:00
jenkins-bot
fc9afe98c9 Merge "Add return type to jsonSerialize()" 2022-07-02 17:13:52 +00:00
jenkins-bot
b1ad148cf6 Merge "SpecialUserrights: Don't pass null to str_replace" 2022-07-02 16:41:26 +00:00
Reedy
b30b8c1f6c SpecialUserrights: Don't pass null to str_replace
Bug: T311921
Change-Id: Ia986dc7d57a14b38b9fe91f4aceea32000e92da8
2022-07-02 17:00:56 +01:00
Reedy
2870b279bd SpecialBlockList: Prevent passing null to trim()
Bug: T311920
Change-Id: I0c101cdaa3a7b83d0fdc31bf03376df4c88a99d7
2022-07-02 16:55:26 +01:00
Reedy
a3095fbb94 Add return type to jsonSerialize()
Bug: T311919
Change-Id: I469deae973ab58ef41aac6a56cea0653a988c05c
2022-07-02 15:34:02 +00:00
jenkins-bot
23c817e24a Merge "ImageListPager: Don't call htmlspecialchars() on null" 2022-07-02 15:28:42 +00:00
Reedy
7a9aed620f SpecialListFiles: user parameter isn't always present
Default to '' instead of null

Bug: T311559
Change-Id: Ie0decd98baff9b123eff94fef83c1aa15b34bfdd
2022-07-02 16:02:21 +01:00
Reedy
6c16fb6e33 ImageListPager: Don't call htmlspecialchars() on null
It's possible img_actor is still null

Bug: T311561
Change-Id: Id94941c268d15898a2002e1a3f7bf2552a83fd39
2022-07-02 15:58:45 +01:00
Umherirrender
7949418333 tests: Expand DerivativeContextTest
Add test for the setter/getter of
Authority, Title, WikiPage and ActionName

Move the inital set into the test function, because some setter
resetting other properties and at test time the state is undefinded.

Also move the unconditional call of UserFactory::newFromAuthority into
::getUser to avoid calling MediaWikiServices from the unit tests

Change-Id: Ibf5eca24f056b2ee5388fa121674366424869f11
2022-07-02 14:43:55 +02:00
jenkins-bot
5d5717df97 Merge "UploadBase::setTempFile() handle $tempPath being passed as null" 2022-07-02 01:25:23 +00:00
jenkins-bot
be2d55a084 Merge "Skin.php: Add change and unblock navigation URLs" 2022-07-01 15:14:41 +00:00