Currently requests to domains listed in $wgLocalVirtualHosts bypass
use of the standard $wgHttpProxy. With WMF's migration to Kubernetes, we
limit outgoing traffic in a much stricter manner, so even internal
requests will need to go over a proxy (e.g. Envoy).
If the domain passes MWHttpRequest::isLocalURL(), then $wgLocalHTTPProxy
will be used if set, otherwise no proxy will be used (current behavior).
Bug: T288848
Change-Id: Ifd0cbab02fa8f14a82ca34ebc7ad95b2be174434
The $wgLangObjCacheSize configuration variable was added in 2012
with commit 121cf60119. From what I could gather, no-one has ever
needed to change its value. Not for any WMF wikis, not for heavy-duty
special-purpose wikis like translatewiki.net, not for any third-parties
that have public configuration files (e.g. Fandom, WikiApiary, Miraheze),
not for developer environments, and not for test suites.
This follows-up 0484ac9e7a, where the implementation changed
from a FIFO array to use MapCacheLRU (which requires a non-zero size)
and thus introduced conditional complexity and code duplication. This
could be simplified by other means, but it seems like we could just
remove it.
Change-Id: I5143e238857f760f2a2ab6f2e0af174872e9cd43
$wgActions used to map string action names to true,
false, a string, a callable, or an object. Now it can also
be an array (that isn't a callable) corresponding to an
ObjectFactory spec for DI.
This patch converts the revisiondelete and rollback actions to
use DI, with the rest to be converted later. The new structure
of $wgActions is fully backwards-compatible.
We don't yet deprecate Action::factory(), ::getActionName(),
and ::exists(), those will be deprecated in a follow-up.
Additionally, we no longer impose a rule that only some
actions can be overridden on a per-article basis via
Article::getActionOverrides().
Bug: T253078
Change-Id: I0fc3c53d671eced1758458f9a0148180b40c6c9b
Number ranges are common and easily mistaken as telephone numbers by
the data detectors of popular browsers. To link a telephone number,
use the explicit [tel:phonenumber display value] syntax.
If you want to re-enable, set the BrowserFormatDetection configuration
variable to false.
Bug: T256758
Change-Id: I49dff3c084d8c9a66defcdae5a1ffb8f35ba8a93
NOTE: this is a backwards incompatible change which will
need to have corresponding changes implemented in CentralAuth
and probably force-merged.
Depends-On: I4c2170a25ea8b1cf5410a4648ebec66a3ab253f3
Depends-On: I612460ec2c6a038b7155b3f38f3261757ba63b4e
Depends-On: I3b91b333753a877aceb177b7d38f9272a044f055
Depends-On: I9ae86c9a5da66d5857fcea9967012c6bbbfc4d45
Depends-On: I4a08af2227d0dfd833e16469df3f76e397dce669
Change-Id: I67bf4f2442269b8aa1002868ede9a71a5ca43a84
$wgShowSQLErrors and $wgShowDBErrorBacktrace have been
deprecated and immediately made no-op since MW 1.32
Change-Id: I655610ac49cb0a836d0c95aa1e6edc087ebf3f4c
Introduce a new schema migration stage in which rev_actor is used
directly and the revision_actor_temp table is no longer needed. This
becomes the new "new" stage whereas the previous situation is now
termed SCHEMA_COMPAT_TEMP.
Introduce migrateRevisionActorTemp which copies data from
revision_actor_temp to rev_actor. The code is similar to
migrateImageCommentTemp.php except that it doesn't delete from the old
table.
Partial revert of c29909e59f. That change removed direct
references to $wgActorTableSchemaMigrationStage and made queries
involving revision_actor_temp be unconditional. Such changes need to be
reverted to make the use of revision_actor_temp be conditional again.
In ActorMigrationTest, I compacted provideGetJoin() and
provideGetWhere(), removing most of the duplication between expected
values. I gave all the stages a short name, and mostly used the name in
providers.
Bug: T275246
Change-Id: I7498107dd6433ab7de5bf2e7b3fe2aa5e10e345d
The old description had some grammatical issues, and did not explain
what it influences or when. Namely, that it considered during manual
purges and overall rebuilds/refreshes. (E.g. it does not cause
update something directly on page views, nor does it kick-off a job
that will upgrade all existing files or something like that.)
Change-Id: Ia2d3f17a9f7c05f816004c619eb9ff1ec45b019b
* Add automatic splitting of large metadata on upload or refresh. If
the reserializeMetadata option is enabled, metadata stored with PHP
serialization will be automatically reserialized to JSON.
* Inject configuration variable $wgUpdateCompatibleMetadata via
LocalRepo instead of accessing it directly.
* In refreshImageMetadata.php and rebuildImages.php, construct a new
LocalRepo with config overrides, instead of overwriting config
globals. Add a helper to RepoGroup to help with this.
* In refreshImageMetadata.php, add new options --convert-to-json and
--split which reserialize metadata and optionally split out large
items to blob storage.
Also, refreshImageMetadata.php was totally broken in the non-force mode
since metadata refresh on page view was disabled in b814245d9f. The
maintenance script was relying on newFileFromRow() magically upgrading
the row, which doesn't happen anymore. So, call maybeUpgradeRow()
directly.
Bug: T275268
Change-Id: I7bf7d9cef71641e287ca4346b568b381f4ada50e
Gated behind the flag $wgParserEnableLegacyMediaDOM. The scattershot
usage of it is a little unfortunate but isn't expected to live very long
so maybe that's acceptable.
Further details can be found at,
https://www.mediawiki.org/wiki/Parsing/Media_structure
Bug: T51097
Bug: T266148
Bug: T271129
Change-Id: I978187f9f6e9e0a105521ab3e26821e36a96b911
In order to avoid major disruptions, I introduced default value to
fallback to but in longer term we probably should deprecated it.
Bug: T285105
Change-Id: I81d9ece769c4942ef2ca390a40ff9d2c24c9ece4
* Optionally store metadata in the database in JSON format instead of
PHP serialization. The new JSON format has a top-level "envelope"
array which gives us a place to store things that are not part of the
handler metadata.
* Optionally split metadata items, putting items above a threshold into
the text table. The FileRepo and MediaHandler must both opt in.
* For staged deployment, the read side of these changes is always
active. Only the write side is configurable.
Bug: T275268
Change-Id: I876ea5c9d3a1881e278f689d2f8a3ae20240c703
ContentHandler::getContentText() was introduced as a migration
helper and is mostly pointless now. Thus it should be deprecated
and later removed. This patch softs deprecates that method.
This patch also deprecates the corresponding setting
$wgContentHandlerTextFallback.
Bug: T268041
Change-Id: I7d477935a16316996c4f52a3d6466029745817b4
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
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
All hard deprecated in 1.35
* BeforeHttpsRedirect
* CanIPUseHTTPS
* UserRequiresHTTPS
Also soft deprecate the wfCanIPUseHTTPS
method, which always returns true. Will
be hard deprecated once callers are updated
Change-Id: Ie6d71809d09edf6be9b8280debeb152ef7fce398
This adds a new type of block restriction for actions, which extends
AbstractRestriction. Like page and namespace restrictions, action
restrictions are stored in the ipblocks_restrictions table.
Blockable actions are defined in a BlockActionInfo service, with a
method for getting all the blockable actions, getAllBlockActions.
Action blocks are checked for in PermissionManager::checkUserBlock
using DatabaseBlock::appliesToRight. To make this work, this patch
also removes the 'edit' case from AbstractBlock::appliesToRight,
which always returned true. This was incorrect, as blocks do not
always apply to edit, so cases that called appliesToRight('edit')
were fixed before this commit. appliesToRight('edit') now returns
null (i.e. unsure), which is correct because it is not possible to
determine whether a block applies to editing a particular page
without knowing what that page is, and appliesToRight doesn't know
that page.
There are some flags on sitewide blocks that predate partial blocks,
which block particular actions: 'createaccount' and 'sendemail'.
These are still handled in AbstractBlock::appliesToRight, and are
still checked for separately in the peripheral components.
The feature flag $wgEnablePartialActionBlocks must set to true to
enable partial action blocks.
Bug: T279556
Bug: T6995
Change-Id: I17962bb7c4247a12c722e7bc6bcaf8c36efd8600
This introduces 2 new tags to track changes in media usage
across articles. These tags are both hidden & disabled by
default.
Bug: T266067
Change-Id: Ia230eadf7dcf6f52facab17b92293f25de38bb1c
1024px is becoming small a world of HiDPI screens. Wikimedia Commons
has worked around for this for over ten years with a JavaScript gadget
presenting links to 2000px. Let's standardise a similar size here so
as to obsolete that gadget.
Note that ThumbnailRenderJob (which is often a performance concern,
since it pre-renders thumbnails for all new uploads), is based on
$wgThumbLimits, not $wgImageLimits.
Bug: T106263
Change-Id: If3be7edc260c69aaedbe87e3ce8f578af57dbda6
Prepare for removal in a couple of weeks. It is already implicitly
called deprecated in HISTORY. Making it explicit.
Bug: T72470
Change-Id: Ieb1d130038823e90d6196d236f02733fd47e03d4
Since 2011, FileDuplicateSearch has been especially awkward as a
QueryPage subclass. The only thing of value in the parent was
construction of <ol></ol> tags, but that's not enough to justify it.
getQueryInfo() was unused -- my motivation is to not have to maintain
it. A LoadBalancer was injected but was unused.
Change-Id: I2f0c18913260ee74ef266352bb93cfbdc1143d85
The main goal was to reduce the size of the "miscellaneous" section,
which I think was successfully achieved. But I also found some
miscategorized settings, and I broadened some small sections.
* Broadened "text storage" to "Content handlers and storage", so that we
have a place for content handler settings. I put a couple of diff
settings here on the basis that they configure
ContentHandler::getSlotDiffRenderer() (or at least should).
* Created a new "security" section as somewhere to put $wgSecretKey and
related misc settings. This is vague and overlapping but better than
just dumping everything in "miscellaneous".
* I split out interwiki settings to a separate section, and put sites
there too, since it seemed quite distinct and there was enough of it.
The remaining "page title" section already had redirects, so I made
that explicit and brought in a few more redirect settings.
* The tiny "statistics" section was broadened to include "content
analysis", which allows us to bring in the new experienced user
settings, by analogy with $wgActiveUserDays which was already there.
Change-Id: Ic1c36664e7535c36db58e2818339e911aad05631
This reverts commit 5a0bfa9d98.
Reason for revert: caused a train blocker (T278429) plus Daniel says it's "super expensive"
Bug: T278429
Bug: T266067
Change-Id: I6724b4bc02d29c12c3fe18cc1e8fa17a443257d5
These are now named $wgDatabaseReplicaLagWarning and
$wgDatabaseReplicaLagCritical, respectively.
Bug: T277987
Change-Id: I62d8c2028fdfee00904f1058f8387499f2b2e977
RememberMeAuthentication request shows a "remember me" checkbox that,
when checked, will extend the amount of time before the authenticated
session expires. It was previously not possible to extend the session
when the login form is skipped, which happens when there are no
non-skippable fields on the form. This patch introduces a configuration
variable, $wgRememberMe. Valid values are:
- CHOOSE_REMEMBER: the user may be able to choose whether to be
remembered or not (depends upon whether login form is skipped)
- FORCE_CHOOSE_REMEMBER: the user will be able to choose whether to be
remembered or not (forces login form not to be skipped)
- ALWAYS_REMEMBER: the authenticated session will always be extended
- NEVER_REMEMBER: the authenticated session will never be extended
Default behavior is identical to what it was before adding this
functionality.
Bug: T265263
Change-Id: I779aae3c1b96b380b50092245f616219088b038d
This is no longer useful. The schema update it supports
has been removed: patch-pp_sortkey.sql/(I76b4235)
Bug: T273978
Change-Id: Ida469a5401f98a028b7a69242105dc1595af3613