aboutsummaryrefslogtreecommitdiffstats
path: root/includes
Commit message (Collapse)AuthorAgeFilesLines
* RequestContext: add @param documentation to setAuthority()Universal Omega2021-05-091-0/+3
| | | | Change-Id: I78caeb1d76aebcf3e8c6ba48128078a0bbec520c
* DatabaseBlock: Hard-deprecate calls to isWhitelistedFromAutoblocks()James D. Forrester2021-05-081-0/+2
| | | | | Bug: T277987 Change-Id: Ic14f38e0e60bd156d1ff04392e65eeceb3ba77b2
* DatabaseBlock::isExemptedFromAutoblocks: Drop fallback message loadJames D. Forrester2021-05-081-2/+0
| | | | | | | | | 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
* Merge "resourceloader: Fix path-only URLs in wiki modules when script path ↵jenkins-bot2021-05-081-2/+14
|\ | | | | | | is docroot"
| * resourceloader: Fix path-only URLs in wiki modules when script path is docrootTimo Tijhof2021-05-081-2/+14
| | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Rename `page_timestamp` revision index"jenkins-bot2021-05-082-0/+7
|\ \
| * | Rename `page_timestamp` revision indexAmmarpad2021-04-302-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Rename to `rev_page_timestamp` Bug: T270033 Depends-On: I16fc273b14e7f4b00e8c31ec1ed7712149aafe37 Change-Id: I93fcfb3caf8c6bd7f9e46921065b751c23571ae1
* | | Merge "Do not call SpecialPage::addHelpLink in constructor"jenkins-bot2021-05-082-2/+10
|\ \ \ | |_|/ |/| |
| * | Do not call SpecialPage::addHelpLink in constructorUmherirrender2021-05-042-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | The help link will show up on Special:SpecialPages if the helplink of Special:SpecialPages is disabled. It also using global context on the message parse inside the function when used in constructor Change-Id: Ia7baee93cffe565d894960d2c7ab86085197b241
* | | Merge "Split TimeCorrection parser into separate class"jenkins-bot2021-05-075-99/+280
|\ \ \
| * | | Split TimeCorrection parser into separate classDerk-Jan Hartman2021-05-075-99/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The parsing of the timecorrection useroption was split over multiple classes. Combine into a single class and add some testcases. Change-Id: I2cadac00e46dff2bc7d81ac2f294ea2ae4e72f47
* | | | Merge "ForkController: Throw more meaningful error for missing PHP extensions"jenkins-bot2021-05-071-12/+12
|\ \ \ \
| * | | | ForkController: Throw more meaningful error for missing PHP extensionsAmmarpad2021-04-171-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently all the signal constants emit warnings as they are undefined in PHP 7.4 and throw fatal error in PHP 8, if pcntl is not available. pcntl extension is not enabled by default, and is not required by MediaWiki, so this class should throw a better error if it's not found. The class already has comment that pcntl and posix are required but this is meaningless since the error and a warning for each constant would be emitted anyway. https://www.php.net/manual/en/pcntl.installation.php Convert RESTARTABLE_SIGNALS constant back to static property as it was, because we can only use these constants after confirming they exist, which happens in the constructor. Bug: T280456 Change-Id: I66deaa9b346b936b2628ac0511492d20a42fea6c
* | | | | Merge "Declare $wgCanonicalNamespaceNames in DefaultSettings.php"jenkins-bot2021-05-071-0/+7
|\ \ \ \ \
| * | | | | Declare $wgCanonicalNamespaceNames in DefaultSettings.phpdaniel2021-05-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Merge "LinkBatch: skip bad input"jenkins-bot2021-05-071-9/+27
|\ \ \ \ \ \
| * | | | | | LinkBatch: skip bad inputdaniel2021-05-071-9/+27
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LinkBatch used to be lenient about receiving null or invalid titles. This patch restores this lenient behavior. Bug: T282180 Bug: T282070 Change-Id: I2c6378a3a0d508c77bcb290a6ed07f4d5f96d62c
* | | | | | Merge "Add null checks for namespaces and actions in blocks"jenkins-bot2021-05-072-18/+25
|\ \ \ \ \ \
| * | | | | | Add null checks for namespaces and actions in blocksSTran2021-05-072-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't show namespaces or actions that are not active (eg. uninstalled extension) in block information Bug: T280798 Change-Id: I14fa7006b3d46eeb41d53216c5203d294fff6338
* | | | | | | Title: avoid instance cache pollutiondaniel2021-05-071-5/+27
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | Bug: T281337 Change-Id: I2e8d18b2fc10509097f66287b2543217f4eb9b6a
* | | | | | Localisation updates from https://translatewiki.net.Translation updater bot2021-05-075-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I9bc1cdefed392f541d9ff05d273e14f000debc68
* | | | | | Merge "ApiQueryLogEvents: when user is specified, omit STRAIGHT_JOIN"jenkins-bot2021-05-071-1/+2
|\ \ \ \ \ \
| * | | | | | ApiQueryLogEvents: when user is specified, omit STRAIGHT_JOINTim Starling2021-05-071-1/+2
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise it tries to scan the whole logging table, joining every row on actor. Bug: T282122 Change-Id: Ia34897a496656e0d0d26f9e038b1edb0377c461e
* | | | | | Merge "LinksUpdate: don't throw if page does not exist"jenkins-bot2021-05-072-13/+39
|\ \ \ \ \ \
| * | | | | | LinksUpdate: don't throw if page does not existdaniel2021-05-042-13/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LinksUpdate may encounter a non-existing page due to race conditions, when the page has been deleted or renamed before the update is executed or even created. We should log such incidents to detect anomalities, but we should not crash hard. Similarly, RefreshLinksJob should not attempt to run on a page that no longer exists. Bug: T281802 Change-Id: Ic73c3e339ff0478710bd57a9f707c1284dcce2d9
* | | | | | | Merge "rdbms: disallow upsert()/replace() calls with multiple unique keys"jenkins-bot2021-05-073-20/+20
|\ \ \ \ \ \ \
| * | | | | | | rdbms: disallow upsert()/replace() calls with multiple unique keysAaron Schulz2021-05-053-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I4b6f07e8c8b3915c780885083f7465790328d2a3
* | | | | | | | Merge "Use a constant for 'Maintenance script' username"jenkins-bot2021-05-072-0/+7
|\ \ \ \ \ \ \ \
| * | | | | | | | Use a constant for 'Maintenance script' usernameGergő Tisza2021-05-032-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user 'Maintenance script' is often used to perform various automated tasks. Providing it everywhere as a string literal is error-prone, and errors can be somewhat disruptive (e.g. with User::newSystemUser with steal=true it can erase the credentials of a legitimate account). Provide a constant instead. Also replace existing uses for consistency. Change-Id: I685a5bfe56bbf1a47f35072f7f7c8be320ee27db
* | | | | | | | | Reorder tables in SpecialWatchlistPetr Pchelko2021-05-061-1/+1
| |_|_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Same issue as in Ifbdb24ff5b99b9ec12cb313c48227563696c48c9 Bug: T282181 Change-Id: I166ef428932136b8466610b8accb78ec6ccdf757
* | | | | | | | Merge "WebInstaller: Don't show the announce-l subscribe checkbox temporarily"jenkins-bot2021-05-061-6/+7
|\ \ \ \ \ \ \ \
| * | | | | | | | WebInstaller: Don't show the announce-l subscribe checkbox temporarilyJames D. Forrester2021-05-051-6/+7
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | … whilst we fix auto-subscription. Hopefully. Bug: T281549 Change-Id: Ifa2e46ee668e51caf87eeca34bec123511595c50
* | | | | | | | Merge "Deprecate legacy actor migration keys"jenkins-bot2021-05-061-6/+19
|\ \ \ \ \ \ \ \
| * | | | | | | | Deprecate legacy actor migration keysTim Starling2021-05-031-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For every table except revision, the use of ActorMigration was "soft deprecated" in 1.34. Now, hard deprecate it. Bug: T278917 Change-Id: I63d26d13026214d84b6b94f06b4ad0d2362d97ed
* | | | | | | | | Merge "Split a base class out of ActorMigration"jenkins-bot2021-05-062-452/+556
|\| | | | | | | |
| * | | | | | | | Split a base class out of ActorMigrationTim Starling2021-05-032-452/+556
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AbuseFilter needs a class which is almost identical to core's ActorMigration, so I split out the generic facilities into ActorMigrationBase, leaving the bits specific to core in ActorMigration. I changed the way fields and tables are specified so that it's easier to override in subclasses. Proper injection of ActorStoreFactory in ActorMigrationTest::testGetWhere() was necessary to avoid a test failure due to a teardown issue. Bug: T278917 Change-Id: I3a6486532f2ef360d1fd01b3a609de71d412f739
* | | | | | | | | Merge "rdbms: use is_file() in DatabaseSqlite::open()"jenkins-bot2021-05-061-5/+1
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | rdbms: use is_file() in DatabaseSqlite::open()Aaron Schulz2021-05-051-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I79ee0a8d357913f64578cf38cf17d969b6661153
* | | | | | | | | | Merge "Eliminate use of Title object in REST infrastructure"jenkins-bot2021-05-0619-273/+407
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | Eliminate use of Title object in REST infrastructurePetr Pchelko2021-05-0519-273/+407
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I585f0f23cac5f6dc2a4879f69f7b83828fda3dd3
* | | | | | | | | | | Localisation updates from https://translatewiki.net.Translation updater bot2021-05-064-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1786595aba5f439b6fdfcd8f4fee1ba0fc518c9b
* | | | | | | | | | | Merge "Remove harmful validation regex in PageReferenceValue"jenkins-bot2021-05-061-8/+1
|\ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | Remove harmful validation regex in PageReferenceValueTim Starling2021-05-061-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Catching common issues here instead of where the caller expects breaks log formatting, including complete breakage of Special:RecentChanges. The doc comment says that validation is the caller's responsibility, which seems like a good idea to me. Bug: T282070 Change-Id: Ic7e5c5576564e61906a812d50ea4e48adf5ac998
* | | | | | | | | | | | Merge "EditPage::getExpectedParentRevision(): guard against null edittime"jenkins-bot2021-05-061-2/+2
|\ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / |/| | | | | | | | | | |
| * | | | | | | | | | | EditPage::getExpectedParentRevision(): guard against null edittimeTim Starling2021-05-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document the fact that EditPage::$edittime can be null, and guard against a type mismatch error in getExpectedParentRevision() which is hit if EditPage::$edittime is null and EditPage::$editRevId is a value that is false when converted to boolean. Bug: T277204 Change-Id: Ibc9500a314ddfd99452d6c03d8906f69cdebc0e4
* | | | | | | | | | | | Merge "WikiPage: Document triggerOpportunisticLinksUpdate and related code"jenkins-bot2021-05-054-9/+46
|\ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | WikiPage: Document triggerOpportunisticLinksUpdate and related codeTimo Tijhof2021-05-054-9/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | == History of WikiPage::triggerOpportunisticLinksUpdate == * 2007 (r19095; T10575; b3a8d488a8) Introduces the "cascading protection" feature. This commit added code to Article.php, in a conditional branch where we encountered a ParserCache "miss" and thus have done a fresh parse. The code in question would query which templates we ended up using, and if that differed from what the database said (e.g. stored during the last actual edit or links update), then a new LinksUpdate is ad-hoc constructed and executed. I could not find it anywhere explicitly spelled out, but my best guess is that the reason for this is to make sure that if the page in question contains wikitext that trancludes a different page based on the current date and time (such as how most Wikipedia main pages transclude news information and "Did you know" information based on dated subpages that are prepared in advance), then we don't just want to re-render the page after a day has passed, we also want to re-do the links update to ensure the search index, category links, and "WhatLinksHere" is correct, and thus by extent, to make sure that cascading protection from the main page does in fact apply to the "current" set of subpages and templates actually in-use. * 2007 (r19227; 0c0c0eff81) This adds an optimisation to the added logic that limits it to pages that satisfy `mTitle->areRestrictionsCascading()`. Thus for most articles, which aren't protected at all, we don't run LinksUpdate mid-request after a cache miss page view. Because of this commit, the pre-2007 status quo remained unaltered and has remains unaltered to this very day: We don't re-index categories and WhatLinksHere etc, unless an article edit or propagating template edit takes place. * 2009 (r52888; 1353a8ba29) Introduces the PoolCounter feature. The logic in question moves to Article::doCascadeProtectionUpdates(). * 2015 (Iea952d4d2e66; df5ef8b5d7). The logic in question is changed, motivated by wanting to avoid DB writes during page views. * Instead of executing LinksUpdate mid-request, we now queue a RefreshLinksJob on the JobQueue, and utilize a newly added `prioritize => true` parameter. This commit also introduces a new feature, which is to queue RefreshLinksJob also for pages that do not have cascading protection, but that do satisfy a new boolean method called `$parserOutput->hasDynamicContent()`, which is set when the Parser encounters TTL-reducing magic words and functions such as {{CURRENTDAY}} and {{#time}}. For this new case, however, the `prioritize` parameter is not set, and this feature is disabled in WMF production (and other farms that enable wgMiserMode). This commit also renamed doCascadeProtectionUpdates() to triggerOpportunisticLinksUpdate(). This commit also removed various documentation comments, which I've partly restored in this patch, the patch you're looking at now. == Actual changes == * Rename hasDynamicContent() to hasReducedExpiry() and keep the previous method as a non-deprecated wrapper. This change is motivated by T280605, in which I intent to make use of a Parser hook that reduces the cache expiry. There are numerous extensions in WMF production that already do this, and thus the assumption that these have "dynamic content" is already false in some cases. I'm not yet sure how or if to refactor this so to allow reducing of the TTL *without* causing this side-effect, but as a first step we can make the method more obvious in its impact and behaviour. I've also updated two of the callers that I think will benefit from this more explicit name and (current) implementation detail. Bug: T280605 Change-Id: I85bdff7f86911f8ea5b866e3639f08ddd3f3bf6f
* | | | | | | | | | | | | rdbms: add an IDatabase method to expose DB server IDsAaron Schulz2021-05-055-5/+47
| |_|_|/ / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: T274174 Change-Id: Ia81e64fa99154f43d27bfe070df03686eb4469c5
* | | | | | | | | | | | Merge "Throw if action codes in getAllBlockActions aren't unique"jenkins-bot2021-05-051-0/+4
|\ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | Throw if action codes in getAllBlockActions aren't uniqueSTran2021-05-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Duplicate action codes (eg. extensions assign colliding action ids) will caused unexpected partial blocking behavior. This lets someone know that there's a duplicate by throwing before that happens. Bug: T281915 Change-Id: I34cab4360d40805a9259cf6f2b4cbf05cee6184c