Commit graph

2076 commits

Author SHA1 Message Date
Amir Sarabadani
c7056e8fd8 Set default migration stage of externallinks to read new and write both
Bug: T341828
Depends-On: I2d4ef8fc3bffa43bc611af3eab0494f4900df557
Change-Id: Ia55cb6cbdb28484e820f9cf3d6aacac00a86ffab
2023-07-13 22:43:43 +02:00
jenkins-bot
ddb4e2ae38 Merge "Add a config to stop shipping the legacy media styles" 2023-07-13 16:00:12 +00:00
Tim Starling
3107340c4f Sort the default config for DefaultUserOptions
It was so close already, it seemed like an effort was being made.

Unfortuately it is not possible to use @phpcs-require-sorted-array
since it breaks ReflectionClassConstant::getDocComment().

Change-Id: I296bb333a49adc973f65b094b727edf7f6143ba1
2023-07-13 14:34:19 +10:00
Arlo Breault
f99dc83677 Add a config to stop shipping the legacy media styles
Since the default for wgParserEnableLegacyMediaDOM is now `false`, this
config will also be set to `false` and wikis can enable it while it's
still necessary.

The plan will be to gradually roll this change out, as was done for
wgParserEnableLegacyMediaDOM, to develop a migration path for templates
and extensions that mimic the legacy media output.

We can start on officewiki.

Bug: T318433
Change-Id: I70e537b2beb99de9a41e7dc66a0d60a508009887
2023-07-12 18:32:31 -04:00
Derick Alangi
988be947d0
DoubleRedirectJob: Inject appropriate service into job p.1
As a first pass, inject various services into the job as this is
now supported by JobFactory.

The second pass will have to survey callers of fixRedirects() and
pass in various services that would be used in the static method.
Also, we need to do same for getFinalDestination() which needs a
DBLoadBalancerFactory service.

Bug: T265942
Change-Id: If61a32b6ce32dc934533603a0e99414ab5771909
2023-07-01 19:59:18 +03:00
Nikolas Nyby
ec2eb0bc23 docs: Fix a few typos in MainConfigSchema
Change-Id: Ib909ef4ba380d0f9dabbd88e6ebd4594686cace9
2023-06-30 19:10:27 -04:00
hmonroy
360182a566 diff: Add inline format switch when Wikidiff2 is installed
Add a switch that allows toggling between inline and two-column format
when Wikidiff2 is installed.

Inline toggle should also support no-JS toggling

The legend should toggle when switching from table to inline after the
first load.

Introduced a temporary feature flag to show this inline toggle so that
we can merge and easily continue the improvements. It will be removed
when ready for production.

Bug: T336712
Bug: T330229
Change-Id: Ie6a48e495f2bb299d8b984e7c40363d534c7915b
2023-06-26 10:31:54 +10:00
jenkins-bot
7f3a64e804 Merge "docs: Update Hooks.md and remove hooks.txt" 2023-06-22 02:26:10 +00:00
jenkins-bot
347d1a9870 Merge "Drop $wgCommentTempTableSchemaMigrationStage" 2023-06-13 10:25:40 +00:00
Alexander Vorwerk
e9211f153e Namespace EventRelayer and EventRelayerNull
Change-Id: I648998172e2b20328d043bfb5866df4486357250
2023-06-11 00:15:46 +02:00
Umherirrender
e9a490db92 docs: Update Hooks.md and remove hooks.txt
- Update the count of HookRunner (since d04f0409)
- Hooks::runner() is deprecated (f452ffe9), should be removed from doc
- hooks.txt is a stub only, history are still in git if needed

Change-Id: I483f249a20853a42767646dc91f50e6187c51c7f
2023-06-09 21:26:52 +02:00
Alexander Vorwerk
27beeac288 Drop $wgCommentTempTableSchemaMigrationStage
This was a temporary flag to allow setting the migration stage for a
comment migration with a temp table.

Since the rev_comment_id migration is done, this is no longer needed.

Dropping the compatibility code for temp tables will be done in
follow-ups.

Bug: T299954
Change-Id: I290a74f27b05cd7e062dda78766911ffe3053d08
2023-06-09 11:32:16 +00:00
Amir Sarabadani
1f695f0368 user: Clean up most calls to LoadBalancer in user-related services
Bug: T330641
Change-Id: Iab0b4a6fca493e003a57df2d85628118ed5ab2fe
2023-06-01 16:56:22 +00:00
Derk-Jan Hartman
01b38b3f30 wgSVGNativeRendering default should be false, not 'false'
Follow-up to I9647fdd72f868c821eb20f67b239826f23655a1c

Bug: T208578
Change-Id: I648521ed044ebd5aa68e5420d73d3c07ca87986f
2023-05-27 10:37:57 +03:00
Simone Cuomo
373a9fb691
Special:Search - Update interwiki sister icons
- [x] Add Wikimedia Icons to project
- [x] Fetch Interwiki icons if they exist
- [x] Fallback to previous functionality for icons not available in OOUI
- [x] Create config to override icons

Bug: T315269
Change-Id: I5d904e467a978847bbc9af65fdba1ef729068993
2023-05-25 09:21:02 -04:00
jenkins-bot
f0157644f6 Merge "Add option to allow SVGs to be rendered clientside" 2023-05-24 12:08:36 +00:00
Derk-Jan Hartman
85dd5826c4 Add option to allow SVGs to be rendered clientside
Add wgSVGNativeRendering to allow clientside rendering of SVG files

Default is false. When enabled with true, will serve ALL SVG files
as is to the browser.
When set to the string 'partial' it will conditionally serve SVG
files based on criteria. Currently it will force PNG rasterization
for translated SVGs and for SVGs over wgSVGNativeRenderingSizeLimit

wgSVGNativeRenderingSizeLimit is a byte size limit to avoid larger
SVG files (potentially much bigger than a PNG) from being served
directly to browser.

Native SVG rendering does not provide PNG fallback. SVG support in
browsers has evolved far enough that this should rarely be a problem.

Bug: T208578
Change-Id: I9647fdd72f868c821eb20f67b239826f23655a1c
2023-05-23 09:33:18 +00:00
Amir Sarabadani
5e453406e5 Change the default skin from Vector to Vector-2022
Bug: T301527
Change-Id: I2ce293be5622f471dd140334a15b3a85abef51c1
2023-05-20 16:58:10 +02:00
Lucas Werkmeister
608da7026d Add Authorization to default $wgAllowedCorsHeaders
This is necessary for client-side OAuth 2.0 applications.

Bug: T322944
Change-Id: Ifae42f2dd6c5139b26e2fa3c96fef9505603859e
2023-05-12 19:13:10 +02:00
Tim Starling
4f540e159a ResourceLoader: In extension schema, validate properties of file info objects
Change-Id: I3d1738265fa3aca5144bf22c47b2198a3ffd49d6
2023-05-10 15:27:35 +00:00
jenkins-bot
c349002235 Merge "ResourceLoader: Allow FileModule scripts to be generated with a callback" 2023-05-10 02:19:38 +00:00
Umherirrender
e8bf1a18db title: Remove protection related deprecated Title functions
- Title::areCascadeProtectionSourcesLoaded()
- Title::areRestrictionsCascading()
- Title::areRestrictionsLoaded()
- Title::getAllRestrictions()
- Title::getCascadeProtectionSources()
- Title::getFilteredRestrictionTypes()
- Title::getRestrictionExpiry()
- Title::getRestrictionTypes()
- Title::getRestrictions()
- Title::isCascadeProtected()
- Title::isProtected()
- Title::isSemiProtected()
- Title::loadRestrictionsFromRows()

Bug: T306131
Change-Id: Id6c3a648453db51c464faeef2ecac4ffaa0676c1
2023-05-10 00:04:20 +02:00
Tim Starling
a59c446154 ResourceLoader: Allow FileModule scripts to be generated with a callback
To implement source maps, we want FileModule::getScript() to return
an array with path information, but that would break subclasses of
FileModule which concatenate to the return value of parent::getScript().
So allow scripts to be generated by a callback, eliminating the need for
concatenation in subclasses.

* Factor out most of the loop body of expandPackageFiles() into
  expandFileInfo(). Add 'name' to the return value. Ensure 'filePath'
  is always a FilePath object since we need that to safely return it
  to ResourceLoader later. Document the return value.
* Make sure the base path is always set in FilePath objects returned by
  expandFileInfo().
* Factor out the loop body of the final stage of file info expansion
  into readFileInfo(). Retain filePath, do not unset it.
* Assert that $fileInfo['content'] is definitely set.
* Convert array_map() in getDefinitionSummary() to a loop.
* Migrate LanguageDataModule.

Bug: T47514
Change-Id: I97d61b5793159cea365740e0563f7b733e0f16de
2023-05-09 11:47:40 +10:00
Amir Sarabadani
c05c261491 auth: Use IConnectionProvider instead of LoadBalancer
Bug: T330641
Change-Id: Ia0722050b66f1d4919dc5f99da0c77cc98f35d92
2023-05-03 13:23:43 +02:00
Thalia
8bfd88c61d Fix typo in MainConfigSchema comment
Change-Id: Ib8f83cdc69eec4aebdc85fab9926ba01abeacc20
2023-05-03 03:23:55 +00:00
Gergő Tisza
5099f79718 Add ForeignResourceDirs extension/skin attribute
Add an extension/skin attribute and a command line option for
manageForeignResources.php, for management of an extension's or
skin's foreign resources. This is less clumsy and more
introspectable than each extension/skin creating its own copy
of manageForeignResources.php.

Bug: T330508
Change-Id: I5df95ea4799d0efce60b58a35cb916c8e0f555b0
2023-04-25 09:27:35 -04:00
Meno25
2369a0b7df docs: Don't point people to deprecated Diffusion copies of gerrit repos
Change-Id: I72e511dba5b607b3b215435b9d7ec8a3621d5cf8
2023-04-03 10:27:57 -04:00
James D. Forrester
6c7177349b ResourceLoader: Raise MW JavaScript startup requirement to ES6
The UA sniffs that overrode the feature tests are no longer needed.

* MSIE 10: Fine, rejected by feature checks.

* UC Mini "Speed Mode": Redundant, the version that this sniff
  matched is pre-ES6. Current versions of UC Mini don't appear to
  support enabling "Speed Mode" on random websites nor does it offer
  it for Wikipedia specifically.
  Details at https://phabricator.wikimedia.org/T178356#8740573.

* Google Web Light: Redundant, shutdown as of 2022.
  Any references or extensions that still reach the proxy, get
  redirected to our online URLs
  https://googleweblight.com/?lite_url=https://en.m.wikipedia.org/wiki/Banana
  https://phabricator.wikimedia.org/T152602
  https://en.wikipedia.org/wiki/Google_Web_Light

* MeeGo: Redundant, discontinued and presumed rejected.
  Either way, unsupported.

* Opera Mini: Fine, rejected by checks.
  Details at https://phabricator.wikimedia.org/T178356#8740573.

* Ovi Browser: Redundant, discontinued and presumed rejected.
  Either way, unsupported.

* Google Glass: Improve UX (since 2013, T58008).

* NetFront: Redundant. Old versions are presumed rejected.
  Current versions are Chromium-based and presumed fine.
  The exclusion was not UX based, but due to jQuery explicitly not
  supporting it in 2013. This is no longer the case, so we can let
  the feature test lead the way here.

* PlayStation: Redundant, same story as NetFront.
  The version that matched the sniff is presumed rejected.
  Current versions probably fine, but even not, don't match
  our sniff so are already enabled today.

Bug: T178356
Change-Id: Ib6263ce3ffd11af5e501de8857f3e48a248c6210
2023-03-30 14:26:05 +01:00
C. Scott Ananian
cfd9c516e1 Allow setting a ParserOption to generate Parsoid HTML
This is an initial quick-and-dirty implementation.  The
ParsoidParser class will eventually inherit from \Parser,
but this is an initial placeholder to unblock other Parsoid
read views work.

Currently Parsoid does not fully implement all the ParserOutput
metadata set by the legacy parser, but we're working on it.

This patch also addresses T300325 by ensuring the the Page HTML
APIs use ParserOutput::getRawText(), which will return the entire
Parsoid HTML document without post-processing.  This is what
the Parsoid team refers to as "edit mode" HTML. The
ParserOutput::getText() method returns only the <body> contents
of the HTML, and applies several transformations, including
inserting Table of Contents and style deduplication; this is
the "read views" flavor of the Parsoid HTML.

We need to be careful of the interaction of the `useParsoid` flag with
the ParserCacheMetadata.  Effectively `useParsoid` should *always* be
marked as "used" or else the ParserCache will assume its value doesn't
matter and will serve legacy content for parsoid requests and
vice-versa.  T330677 is a follow up to address this more thoroughly by
splitting the parser cache in ParserOutputAccess; the stop gap in this
patch is fragile and, because it doesn't fork the ParserCacheMetadata
cache, may corrupt the ParserCacheMetadata in the case when Parsoid
and the legacy parser consult different sets of options to render a
page.

Bug: T300191
Bug: T330677
Bug: T300325
Change-Id: Ica09a4284c00d7917f8b6249e946232b2fb38011
2023-03-26 21:46:05 -04:00
jenkins-bot
7c92610ada Merge "Fix some typos" 2023-03-23 12:20:11 +00:00
jenkins-bot
43c842074e Merge "Allow a temp username pattern to be reserved without activating the system" 2023-03-23 02:26:51 +00:00
Matěj Suchánek
c231736471 Fix some typos
Bug: T201491
Change-Id: I5c9408c262f09c936525f35abfacfa92a193b791
2023-03-21 15:58:09 +01:00
Arlo Breault
892781fe94 Change the default of wgParserEnableLegacyMediaDOM to false
The 7% increase in css shipped is because of styles added for the
content-media feature, without dropping content-thumbnail.  This is
noted in T297984#8525146

Getting rid of content-thumbnail won't be possible until templates and
extensions that mimic the parser output have been migrated, which is
being worked on in T318433.

Bug: T314318
Bug: T297984
Bug: T318433
Depends-On: Ib54b49d546423dd1b4416c82585bbb686950b29c
Change-Id: Ic587b1b9b8d22f3aef38e8823613815faaa09d9d
2023-03-17 12:09:29 -04:00
Tim Starling
b39f13975c Allow a temp username pattern to be reserved without activating the system
Split concepts of "match pattern" and "reserved pattern". Add config
"reservedPattern" which specifies a username pattern to be denied for
creation, but unlike matchPattern, it does not immediately flag all
accounts with such names as temp accounts. This can be used before
migration or after rollback to safely prevent creation of conflicting
accounts.

* Add TempUserConfig::isTempName(), which does what isReservedName()
  previously did, i.e. determines if a name is a temp username.
* Make TempUserConfig::isReservedName() return true if the name matches
  either the match pattern or the reserved pattern.
* UserNameUtils::isTemp() continues to determine whether a username is
  actually a temp username.
* Add UserNameUtils::isTempReserved() as a proxy for
  TempUserConfig::isReservedName()

Bug: T307064
Change-Id: I26755731fad89530a06824181106cd7b4e077d9e
2023-03-15 09:02:20 +11:00
Tim Starling
9e534bd0d8 Renameuser: tweaks and followups
* Use IConnectionProvider
* Inject services into the job
* Use JobSpecification to avoid unnecessary service construction

Bug: T27482
Change-Id: I75ac8c53b874742a3a54526692767d0f549e5259
2023-03-13 09:20:53 +11:00
jenkins-bot
39e2001335 Merge "objectcache: Remove $wgMainWANCache and $wgWANObjectCaches" 2023-03-07 23:07:49 +00:00
Timo Tijhof
39ead04e98 objectcache: Remove $wgMainWANCache and $wgWANObjectCaches
We always wrap the local cluster cache, and there are no subclasses
of WANObjectCache. It was never documented or recommended how these
would be used. It is a left-over from the original 2015 Multi-DC plan
in which WANObjectCache would work differently. See task for details.

Note that this requires no configuration changes, even in the
theoretical case of these variables being used, as the only
option is to use the main cache, and that's also the default.

* Update WAN overrides to override the underlying main cache
  instead.
* Fix EditPageTest which was previously implicitly using a 'hash'
  as main cache but also relying on wan cache to be 'none'.
  The part that it actually needs is the 'none'. When WAN cache is
  enabled, testUpdateNoMinor fails due to an edit conflict because
  one of the edits it makes is made with a current timestamp whereas
  it expects to simulate wpEdittime in the year 2012 which, when
  caching is enabled, is ignored and becomes the current time instead.
  I don't understand exactly why, but I'm going to conserve that
  behaviour for now.
* Fix TemplateCategoriesTest, which was failing due to an unexpected
  cache hit:
  > [objectcache] fetchOrRegenerate(…:page:10:…): volatile hit
  This could be solved in a more realistic way by splitting the test,
  or by explicitly resetting services half-way the test to clear
  WikiPageFactory, PageStore and WANCache process state.
  For now, keep the prior behaviour of no cache in this test.

Bug: T305093
Bug: T329680
Depends-On: If890622eed0d0f8b4bd73d36ba1815a3d760ea05
Depends-On: Ie1def75208822bdf19bb2cfd7e6edf32c2000e6b
Depends-On: I35cce61dc3ee90dcee3dd6f0b36f84133be029ed
Change-Id: I53781a8c06ebb2583f6ca83dd91bbfe8a5c88b13
2023-03-07 22:47:04 +00:00
Derk-Jan Hartman
005d20e470 Remove IEContentAnalyzer
This supported mostly IE 6 and 7 as well as some very old Safari
versions against sniffing. Browsers later implemented
X-Content-Type-Options: nosniff which should protect against this
problem.

Bug: T309787
Change-Id: Iea61bd82033551008eb1832fe899ea28ccb23385
2023-03-07 02:27:45 +00:00
jenkins-bot
69bbd363ef Merge "editpage: Minor docs and file header cleanup" 2023-03-05 09:57:45 +00:00
Timo Tijhof
adcad48159 editpage: Minor docs and file header cleanup
* Remove duplicate descriptions from file blocks in favour of class
  doc blocks. This reduces needless duplication and incorrect or
  outdated copies, and helps to make the file header more consistently
  visually ignorable.

* Clean up the file header, similar to other commits under
  <https://gerrit.wikimedia.org/r/q/message:ingroup+owner:Krinkle>.

Change-Id: I31b137b1d6c75eb042d935b99f92ef47652596ec
2023-03-05 02:20:23 +00:00
Tim Starling
7efc7f7518 Copy the Renameuser extension into core
Copy the Renameuser extension into core, with minimal code changes. The
hook handlers are inlined into Article, SpecialLog and
SpecialContributions.

Bug: T27482
Change-Id: I314021f4138773df6aaf2753b33ab8283cd16974
2023-03-03 09:39:39 -05:00
daniel
0089787c37 Move config-vars.php to docs, since it's documentation.
config-vars.php is not supposed to be executed, it provides declaration
stubs for use by IDEs.

Change-Id: I32c034d05bf2354cdaa5f02d19031421cbae78a1
2023-03-02 13:51:09 +01:00
jenkins-bot
d236f24059 Merge "Rename rate limits to match permission names" 2023-02-26 23:53:59 +00:00
daniel
d4f785d931 Rename rate limits to match permission names
This changes the name of the rate limits to match the name of the
corresponding permission:

1) "emailuser" is now "sendemail".
2) "changetag" is now "changetags".

This is done in preparation for merging rate limit checks into Authority.

Backwards compatibility is retained, but the old keys trigger a settings
warning which will be shown by the updater.

Bug: T310476
Change-Id: I59163c88a3f9237ee4592f4b51e3f56359f73fc0
2023-02-26 13:21:40 +01:00
Cole White
fa92ab43e9 Metrics: rename Metrics lib to Stats
Bug: T240685
Change-Id: Ie43d894b6b4030a88e397495d40886ccb6e69835
2023-02-24 23:01:32 +00:00
jenkins-bot
3354336bf1 Merge "Hard-deprecate Language::getLocalisationCache/getMessagesFor" 2023-02-22 22:01:53 +00:00
jenkins-bot
677b99a24f Merge "Update $wgJobRunRate comments to mention buffers and fastcgi" 2023-02-21 02:06:23 +00:00
Umherirrender
965d7ed49a specials: Create Special:MyLog to link to logs performed by me
Special:Log allows to have the type, the user or type + user as subpage,
link to this page to show logs from me.

- Special:MyLog redirects to Special:Log/<me>
- Special:MyLog/create redirects to Special:Log/create/<me>

This does not show logs against me (like blocks)

Bug: T327565
Change-Id: Id624cb84d8bbac87d2f820c7c283d4c13866bff5
2023-02-16 21:17:17 +00:00
Timo Tijhof
7cbb74133e Remove obsolete Rdbms query groups from getConnection calls
The currently supported groups are documented in database.md.

While at it, prefer the string form of the $groups parameter where
possible, since the complexity of an array is never utilized, as the
groups either can't overlap, or are decided on by the caller instead.

This also helps with the simpler LBFactory::getConnection() proposed
in T326274.

Bug: T263127
Bug: T326274
Change-Id: I7a31a07a8c3f1e265ac43ab59f23326590b407c3
2023-02-15 17:10:26 +00:00
Aaron Schulz
390c289940 Update $wgJobRunRate comments to mention buffers and fastcgi
Change-Id: Iab0c8c842492abe540260cfbc8178b007bd04c85
2023-02-15 01:10:40 -08:00