Commit graph

1847 commits

Author SHA1 Message Date
C. Scott Ananian
84d0dff968 HtmlHelper: Add "legacy compatibility" mode
When using HtmlHelper for style deduplication, slight differences in
the serialization format used by the legacy parser caused test failures.
Add a "compatibility" mode which tries to better match legacy parser
behavior for void elements, character escapes, and other details.

Parsoid HTML has always been serialized using an HTML5 serializer,
so this compatibility mode will be disabled when processing Parsoid
HTML.

Change-Id: I0441aa3e44f6562e05e95a18cc282c53fe446788
2023-12-11 21:04:50 +01:00
Tim Starling
0b143b0e26 rdbms: Simplify TRUNCATE handling
Tracking of "pristine" status in Database supported omission of TRUNCATE
queries for temporary tables that are untouched by unit tests. Since we
now detect the used tables, this is no longer necessary.

Also, make the temp table info into a class.

Change-Id: I57ff5b43cc7551ca32130f6987edd5f7c4f79910
2023-12-11 14:29:52 +11:00
jenkins-bot
6b7b92c72b Merge "Remove support for extensions requiring a MW version via Composer" 2023-12-10 05:06:15 +00:00
Isabelle Hurbain-Palatin
d50deb23e8 Introduce ContentDOMTransformStage
This subclass is used for transformations that apply to the DOM tree.
For now, we load the document from the string in ParserOutput and store
it back; ultimately, this will be replaced by a direct access to the DOM
content of the ContentHolder/HtmlHolder.

Change-Id: Ibc46c34072eadb3e84f69df49a3a424f3864c952
2023-12-08 18:27:30 -05:00
Bartosz Dziewoński
83b5e13f3d LocalisationCache: Update references to globals / main config
The values are already passed as ServiceOptions, but the dependency
tracking code was still reading globals / main config.

Change-Id: I66207f1a217249c596df4edabbd16e8cc7745fb7
2023-12-09 00:13:10 +01:00
Isabelle Hurbain-Palatin
a3f51c732d Refactor DefaultOutputTransform into a pipeline of transforms
Bug: T348253
Change-Id: I53551ec6d6471569709c71c1155729e550f64de8
2023-12-08 18:06:19 -05:00
jenkins-bot
3dcc6006ce Merge "Output: Add IframeSandbox class" 2023-12-08 22:29:59 +00:00
Max Semenik
d0e0113648 Remove support for extensions requiring a MW version via Composer
Dependency of an extension upon particular MediaWiki versions should
be expressed in extension.json. As brought up on wikitech-l, we still
have the code that injects a virtual mediawiki/mediawiki package into
Composer so that extensions can express a dependency upon particular
MediaWiki versions in composer.json. This is duplicate information
potentially introducing inconsistency. This patch removes support for
this capability. Per codesearch, there are no remaining extensions
found using this feature.

The classes in includes/composer are removed immediately as they've
never been intended for extensions to use, while MediaWikiVersionFetcher
is marked for standard deprecation.

Bug: T467
Bug: T249573
Change-Id: I62bacca45e4680812dd42f4e061ca7da17bfcdbb
2023-12-07 05:10:13 -08:00
Daniel Kinzler
b73cc87dd1 Re-apply "REST: Emit swagger spec"
This reverts commit 890558f1fa.
This restores Id584208d9b67d877606a0add1d71c9b1784cdb1b with some fixes.

Bug: T323786
Bug: T352742
Change-Id: Ib31c451ddd75b06c95a544c8a3d2a64b32264126
2023-12-06 11:20:11 +01:00
Urbanecm
890558f1fa Revert "REST: Emit swagger spec"
This reverts commit bb4b5c5f87.

Reason for revert: patch breaks CI

Bug: T352742
Change-Id: Iaf57bad945f5cbd01508a513f0d219ec4b510ce8
2023-12-05 10:37:48 +00:00
daniel
bb4b5c5f87 REST: Emit swagger spec
This is only enabled in development mode for now.
It's intended as a baseline for further development,
the feature is not ready for production.

Bug: T323786
Change-Id: Id584208d9b67d877606a0add1d71c9b1784cdb1b
Co-authored-by: Atieno <pnjira@wikimedia.org>
2023-12-04 16:28:32 +03:00
C. Scott Ananian
cb09a27cc2
Output: Add IframeSandbox class
Add a class for wrapping arbitrary HTML content in an iframe,
with an interface similar to that of OutputPage. The iframe
uses 'sandbox="allow-scripts"' (which disallows various actions
for scripts executed in the iframe, most notably access to any
browser data for the website embedding the iframe), making it
suitable for running untrusted scrips.

This is a minimal patch to get the a feature in a state where
it can be tested in staging. It's not intended for real-world
use yet.

See P53299 for hooking up the code for manual testing.

Soft-depends on  I3ce24a1b1d2635ba46d1af1c51dccb292dfdbc55.

Bug: T222807
Bug: T169027
Co-Authored-By: Gergő Tisza <tgr.huwiki@gmail.com>
Co-Authored-By: C. Scott Ananian <cscott@cscott.net>
Change-Id: I658c7f3c751505ce4045047a19f11da1d236cd88
2023-12-03 22:33:17 -08:00
Umherirrender
094f0b4fe6 Remove Hooks class, all contents deprecated in 1.35 or 1.41
This includes the deprecated static functions:
- Hooks::register()
- Hooks::clear()
- Hooks::isRegistered()
- Hooks::getHandlers()
- Hooks::run()
- Hooks::runWithoutAbort()
- Hooks::runner()

Bug: T335536
Change-Id: I77b8cccefe50868a087a20fc67a3d8f8d5fb1a63
2023-11-30 17:14:00 -05:00
jenkins-bot
b7fc1b2f43 Merge "Only cache expensive renderings" 2023-11-30 21:24:34 +00:00
daniel
e3fb964439 Only cache expensive renderings
Pages that are fast to render can be omitted from the parser cache
to preserve disk space and cache write operations.

The threshold is configurable per namespace, so the tradeoff can
be evaluated based on different access patterns. For example, pages
that are accessed rarely, like file description pages on commons,
may have a high threshold configured, while pages that are read
frequently, like wikipedia articles, may be configured to be always
cached, using a 0 threshold.

Filtering is based on a time profile recorded in the ParserOutput.
A generic mechanism for capturing the timing profile is implemented
in the ContentHandler base class. Subclasses may implement a more
rigorous capture mechanism.

Bug: T346765
Change-Id: I38a6f3ef064f98f3ad6a7c60856b0248a94fe9ac
2023-11-30 20:56:12 +00:00
Martin Urbanec
6ec01553c5 Move StaticUserOptionsLookup to the MediaWiki\User\Options namespace
Follow-up to I9822eb1553870b876d0b8a927e4e86c27d83bd52,
I missed the Static class in that patch.

Bug: T352284
Change-Id: I42653491c19dde5de99e0661770e2c81df5d7e84
2023-11-29 14:08:40 -05:00
Martin Urbanec
29af4dd074 Move user options related classes into its own namespace
There are a couple of user options related classes already,
and the T321527 work on dynamic defaults is going to add
even more. Let's move them into a separate namespace
to make core a bit more organized.

Old name is kept as an alias for compatibility purposes.

Bug: T321527
Bug: T352284
Change-Id: I9822eb1553870b876d0b8a927e4e86c27d83bd52
2023-11-29 13:27:13 +01:00
Tim Starling
d6727856fd Support new block schema
Support migration stages when reading and writing blocks.

I tried to set it up for an easy next stage, in which support for the
old schema is removed. I tried to avoid factoring out of shared code
between the two schemas, so that the old schema cases can simply be
deleted without the need to revert unnecessary abstractions.

However, I added HideUserUtils to factor out ipb_deleted queries. Code
review showed that this was already quite complex, with multiple
approaches to the problem, so it benefits from refactoring even without
the schema abstraction.

HideUserUtils is a service rather than a standalone class to support
unit tests, since unit tests do not allow global config access. When
the migration stage config is removed, it will be a service with no
constructor parameters -- an unnecessary abstraction which should
ideally be resolved at that time.

When interpreting result rows, it is possible to share code by using
field aliases. But when constructing WHERE conditions, the actual field
names need to be used, so the migration is more intrusive in
ApiQueryBlocks and SpecialBlockList, where complex conditions are used.

Bug: T346293
Bug: T51504
Bug: T349883
Change-Id: I408acf7a57b0100fe18c455fc13141277a598925
2023-11-29 13:31:42 +11:00
jenkins-bot
77b3df20da Merge "title: Drop TitleArray in favor of TitleArrayFromResult" 2023-11-28 18:02:04 +00:00
James D. Forrester
67217d08df Namespace remaining files under includes/deferred
Bug: T166010
Change-Id: Ibd40734b96fd2900e3ce12239d09becfb4150059
2023-11-22 10:08:53 -05:00
Daniel Kinzler
32c12be6fe Re-apply "Rest: replace use of deprecated pingLimiter method"
This introduces RestAuthorizeTrait to ensure proper error reporting
after calls to Authorizer methods to avoid misleading error reports,
see T350117 and T350202.

This reverts commit e047668d9f.
This restores change 701ff30193.

Change-Id: I617cb7ba24a1614c39e2b1072888f0ee7b3127e3
2023-11-22 13:57:06 +11:00
Daimona Eaytoy
71ff052677 Replace MediaWikiIntegrationTestCase::$tablesUsed with automatic query tracking
This patch deprecates the $tablesUsed property, and introduces a new
utility, ChangedTablesTracker, that automatically keeps track of all
tables changed in a test. Every table used is now guaranteed to be reset
after the test.

Note that tables changed in addDBDataOnce are only cleared at the end of
the test class, or the data would be lost.

Fix a test in SpecialBlockTest which would fail with this patch.

$tablesUsed is now a no-op and can be removed from all tests that
declare it.

Bug: T342301
Change-Id: Ie2f1809dac243ef06ba0c34f039ce4e62cbf99cf
2023-11-21 10:35:59 +11:00
Amir Sarabadani
beb3261b8d Remove language coverter for Kazakh
This has been constantly mentioned as buggy and broken and there is no
official version of latin or Arabic (see the ticket for more details).

This can be turned back as an extension if needed by third party users.

Bug: T350684
Bug: T268143
Depends-On: I6180dca2c49b3119751766268acc56087aaf8414
Change-Id: Ifbf3c8954d885daf891f8d9efc11743d898302f0
2023-11-20 10:31:16 -05:00
jenkins-bot
1a1ffc4ad6 Merge "Edit Recovery: add new special page to list unsaved changes" 2023-11-13 12:06:57 +00:00
Sam Wilson
fb2f0d003c Edit Recovery: add new special page to list unsaved changes
Add Special:EditRecovery to dispaly a basic list of all pages
with locally-saved edit recovery data. This change just sets up
the initial work for this, and the actual design and improved
UX will come in subsequent changes.

Bug: T347673
Change-Id: I8edbfd21258fcb2e4fc9f3e4ded9876d6635d752
2023-11-12 15:28:25 +08:00
jenkins-bot
a9a163f62f Merge "Change EditPage 'edit' rights check to do per page instead of general" 2023-11-10 01:12:33 +00:00
Martin Urbanec
c9908da103 IP Masking: Expire temporary accounts in 1 year
Why:
Temporary accounts (introduced as part of IP Masking)
are supposed to expire 1 year after their registration.
Automatic account expiration can be done via a maintenance
script, which would be periodically executed via cron / systemd.

Make it possible for extensions to provide their own logic
for generating a list of temporary accounts to invalidate.
This is used in CentralAuth to base registration timestamp
on the global registration timestamp.

The default behavior is "temporary accounts do not expire",
given the feature requires a maintenance script to run
periodically, which will not be the case on third party
instances.

What:
* Add `expireAfterDays` to $wgAutoCreateTempUser, controlling
  how many days temporary accounts have.
* Add UserSelectQueryBuilder::whereRegisteredTimestamp(),
  filtering accounts based on user_registration.
* Add ExpireTemporaryAccounts maintenance script, which is
  @stable to extend.

Bug: T344695
Change-Id: If17bf84ee6620c8eb784b7d835682ad5e7afdfcc
2023-11-09 15:11:48 +01:00
Brian Wolff
d3f38054a9 Change EditPage 'edit' rights check to do per page instead of general
Previously the edit rights check would fail if you didn't have edit
rights in general. This made it difficult to write custom permission
extensions that want to give users edit rights to a few specific pages
while not giving rights in general.

This check goes back to 2005 when the edit rights system was first
introduced a2a28a34c1. Presumably per-page permissions didn't exist
yet.

Bug: T342515
Change-Id: Ibcf0e18c44912abdd02a676a551da3cc7ed22ee0
2023-11-04 21:46:03 +06:00
jenkins-bot
69b6191820 Merge "Remove cleanupUsersWithNoId.php" 2023-11-03 22:56:56 +00:00
jenkins-bot
fc41681088 Merge "Move DatabaseBlock read query methods to DatabaseBlockStore" 2023-11-03 17:54:30 +00:00
Amir Sarabadani
f60e576c69 rdbms: Add support for LIKE in expression builder
Bug: T210206
Change-Id: Iec33a64bb1ec1485ce91b8b05e660f8c1723182b
2023-11-03 02:03:44 +01:00
Tim Starling
d06ac1a3cd Move DatabaseBlock read query methods to DatabaseBlockStore
* Move to DatabaseBlockStore the DatabaseBlock methods newFromID,
  getQueryInfo, getRangeCond, newFromRow, isExemptedFromAutoblocks,
  doAutoblock, updateTimestamp, getAutoblockExpiry, newFromTarget,
  newListFromTarget.
* Split DatabaseBlock::getBlocksForIPList. Now
  BlockManager::getBlocksForIPList() is responsible for XFF header
  validation and trusted proxy handling. DatabaseBlockStore::
  newListFromIPs() just does the queries and constructs the Block
  objects.
* In DatabaseBlockStore::newFromRow() and doAutoblock(), use the
  DatabaseBlock constructor instead of calling many setter methods. Add
  constructor options decodedExpiry, decodedTimestamp, id,
  parentBlockId and restrictions to support this.
* Move isExemptedFromAutoblocks() to its own service. Remove the cache
  since in my testing with production eval.php, the WAN cache fetch is
  10 times slower than just using the message cache, contradicting the
  comment written in 2008.
* Fix AuthManagerTest which was previously passing an unrecognised
  "restrictions" option to DatabaseBlock. Now that the option actually
  works, we have to use the right type.

Bug: T255433
Change-Id: I5049e60be1681f67fcca133e569e315792dc42dd
2023-11-03 11:00:57 +11:00
Tim Starling
cbe6714a99 Remove cleanupUsersWithNoId.php
All of the fields it's cleaning up have been deleted. The script cleans
up denormalized username fields which were deleted in the actor
migration.

It skips tables for which the name fields don't exist, which is all of
them.

Change-Id: I407a75c85cbd5ff6ab0d6d48d2bf07793e7c0c3e
2023-11-03 10:51:30 +11:00
jenkins-bot
13c7f7d56f Merge "Add ApiCreateTempUserTrait for APIs that create temporary users" 2023-11-02 19:55:31 +00:00
Thalia
9396cd6eed Add ApiCreateTempUserTrait for APIs that create temporary users
Refactor EditPage's logic for getting a redirect URL into a trait
that can be shared between classes that exteend ApiBase.

Bug: T349223
Change-Id: I7cafa0bfc17a75d44e1d83b9561b4b2778b5f132
2023-11-01 13:29:02 +00:00
Amir Sarabadani
f64db42f62 rdbms: Drop some of class aliases of DatabaseMySQL
They were supposed to be dropped before 1.41 release.

Depends-On: Icd972535725e65e6eaed25607f1fd1c69d6b3a5c
Change-Id: Ieeaf39ec07407a55daa51c350cd57b66283a27bb
2023-10-31 23:18:21 +00:00
Derick Alangi
e54665dccb title: Drop TitleArray in favor of TitleArrayFromResult
This patch kills TitleArray and makes TitleArrayFromResult the way
forward.

Change-Id: I056edecbee69114c77d14ecc9e7fe6212262a970
2023-10-31 12:01:51 +00:00
daniel
04197cb13f Introduce StatusFormatter
This takes us one step closer to deprecating Status,
so we can isolate StatusValue from presentation logic.

FormatterFactory is introduced as a mechanism for
getting instance of formatters that need access to the user interface
language and other request dependent information.

Usage is demonstrated in thumb.php, SpecialCreateAccount, and
SearchHandler. The examples indicates that there is no work do
be done around ErrorPageError and LocalizedHttpException.

Change-Id: I7fe5fee24cadf934e578c36856cc5d45fb9d0981
2023-10-27 14:56:51 +02:00
Derick Alangi
5bca452be3
lib/virtualrest: Drop the virtualrest library
Code is no longer used and all previous usage has been replaced
with the appropriate HTTP logic and cleanup has been taken care
of.

As a follow-up to this patch, I'll be finally removing the
`$wgVirtualRestConfig` setting from core and extensions.

Bug: T338921
Change-Id: I7e1fff996033ba26e1b3dd229dd299a64c610707
2023-10-23 11:02:59 +01:00
jenkins-bot
49859c6bd4 Merge "rdbms: Introduce expression builder" 2023-10-20 20:49:27 +00:00
Amir Sarabadani
3ef6662f31 rdbms: Introduce expression builder
To avoid accepting raw SQL in conditions and avoid the need to call to
addQuotes() which might get forgotten and open a SQL injection vulnerability.

A migration path would be something like the following:

Before:
'rev_timestamp > ' . $db->addQuotes( $timestamp )
After:
$db->expr( 'rev_timestamp', '>', $timestamp )

See the ticket for more information and reasoning.

Bug: T210206
Change-Id: I72431410c21ab97e797c7df07bf0dedd19307e65
2023-10-20 20:15:55 +00:00
Tim Starling
69e8a152d5 Remove UserRightsProxy
And have UserGroupManagerFactory cache instances, per the TODO.

I'm doing this because SpecialUserRightsTest was flaky when there are
two local instances of UserGroupManager floating around. Resolving the
todo is the simplest way to ensure there is only a single
UserGroupManager. There are no remaining usages of UserRightsProxy in
codesearch.

Change-Id: Icb3395dfc53a4441b667f001ac1227f36d1f2e8d
2023-10-20 10:10:24 +11:00
Isabelle Hurbain-Palatin
36b4ab44f6 Refactor ParserOutput::getText into DefaultOutputTransform service
This also introduces the ephemeral field "$mTransformedText" to store
the result of transformation in ParserOutput.

This is a first step before the transformation uses HtmlHolder as input
and output.

Bug: T348253
Change-Id: I312f3748ebfb0373ee3542ba0abdeefe7db1d488
2023-10-16 13:11:38 +02:00
Tim Starling
03ceb372b3 Add cache to BlockManager
Add a cache to BlockManager, so that we can get rid of the block cache in
User.

The cache stores up to three blocks -- a request block, a user block and
an anonymous (IP) block. Using object identity to compare keys means
that we can avoid serializing the WebRequest and UserIdentity.

Bug: T345683
Change-Id: I7639766519861690a759629144c8680767539293
2023-10-12 13:42:58 +11:00
jenkins-bot
e8340a75c7 Merge "Remove deprecated interface ParserTestTablesHook" 2023-10-03 20:11:04 +00:00
jenkins-bot
aa5008f24e Merge "ResourceLoader: Improve and generalize validateScriptFile test coverage" 2023-10-03 19:33:52 +00:00
Umherirrender
42152f5fb4 Remove deprecated interface ParserTestTablesHook
The hook is no longer called, so the deprecation warning of the
HookContainer (as mention in DeprecatedHooks) cannot work as expected.

Change-Id: Idb586e9c2d8ba87411acc137537db6d6c75485a7
2023-10-03 19:52:49 +02:00
jenkins-bot
c7fe8a109d Merge "Revert "Revert "Remove unused class_alias deprecated in MW 1.40""" 2023-10-03 17:03:31 +00:00
Timo Tijhof
8f778a8b23 ResourceLoader: Improve and generalize validateScriptFile test coverage
In preparation for the underlying library changing, generalize the
tests for this code so that test changes are kept to a minimum in
the actual commit. Rather than test the upstream directly, move
our custom test cases from JsMinPlusTest to ResourceLoader/ModuleTest.

Fix benchmarkJSMinPlus.php to not emit warnings on PHP 8.2 due to
use of dynamic property creation:

> PHP Deprecated:  Creation of dynamic property JSNode::$readOnly
> is deprecated in /mediawiki/includes/libs/jsminplus.php:1728

Bug: T75714
Change-Id: I0515be8229f51de48c1f0c92f09e2d827e1b1add
2023-10-02 18:46:25 -07:00
Fomafix
19d4adbe1c Remove deprecated class alias GetBlockErrorMessageKey
Deprecated since 033e75cb26 included in MediaWiki 1.40.
Use GetBlockErrorMessageKeyHook instead.

Change-Id: I346c7ec9ed7d57e3d1e1aa9f761d24e87c4ec513
2023-10-02 21:44:19 +00:00
Isabelle Hurbain-Palatin
33908cebed Revert "Revert "Remove unused class_alias deprecated in MW 1.40""
This reverts commit cbde6b69de to re-apply
the initial patch. This should only be merged once
I2acfd0b7a1e48aec107ded3bbe4963e2df24f4d3 is deployed.

Change-Id: If12ab65b1d773946fca6c8601ff51290136549c8
2023-09-29 13:08:50 +02:00
Isabelle Hurbain-Palatin
cbde6b69de Revert "Remove unused class_alias deprecated in MW 1.40"
This reverts commit ec22840c4a.

This patch currently creates issues on beta, which still runs with the
latest vendor version of Parsoid. If, for some reason, Parsoid doesn't
get deployed with this patch, I2acfd0b7a1e48aec107ded3bbe4963e2df24f4d3
doesn't get included, and the REST page handler breaks.

Staggered deploy seems safer in this context, hence the proposal for a
temporary revert, and a merge after the next Parsoid vendor patch is
deployed.

Change-Id: I3f859fa807a04892a67323cd4e98be0d3fbb1676
2023-09-29 11:21:49 +02:00
jenkins-bot
e344c53b2c Merge "Remove unused class_alias deprecated in MW 1.40" 2023-09-28 19:03:09 +00:00
Fomafix
ec22840c4a Remove unused class_alias deprecated in MW 1.40
The Helper classes are deprecated since 1afd52e3e4.

Depends-On: I2acfd0b7a1e48aec107ded3bbe4963e2df24f4d3
Change-Id: Ie9973c6d6474bb7b4720c0641ca7492dc946d923
2023-09-28 18:47:13 +00:00
Fomafix
2c3b5df69b Remove deprecated class Wikimedia\Rdbms\MySQLMasterPos
The class name MySQLMasterPos is deprecated since d11c59538a included
in MediaWiki 1.37.

Bug: T282894
Change-Id: I1dd75261dc031da5aef3873b60cb2d86367b44be
2023-09-26 10:11:35 -04:00
Amir Sarabadani
c00148768c Introduce LoggingSelectQueryBuilder
To replace DatabaseLogEntry::getSelectQueryData()

Many migrations can't happen right now because of use of
ChangeTagsStore::modifyDisplayQuery() but I will fix that soon.

Bug: T344971
Change-Id: Iafb2bb5ea3a0da49da1dafb69b65dea3c15029ed
2023-09-25 15:51:24 +02:00
jenkins-bot
369a629996 Merge "Add new maintenance script cleanupPageLang.php" 2023-09-23 18:11:50 +00:00
Bartosz Dziewoński
35596d980a installer: Add database updater for 2008/2011 redirect schema changes
In 2008, the `redirect` table was added, and in 2011, it gained the
fields `rd_interwiki` and `rd_fragment`. We have never performed
proper maintenance for those changes, instead relying on code in
WikiPage to update it when the page was visited, or on an optional
run of refreshLinks.php.

I would like to remove the code in WikiPage, so we probably need to
perform this maintenance in the database updater. You know, for the
millions of people who have been dutifully upgrading their MediaWiki
installations since 2008, but never visited the pages there.

The script is a trimmed-down version of refreshLinks.php, without all
the weird stuff, and using a better index for the queries.

Bug: T346290
Change-Id: Iea251d2737b2fb472c4efb060ad2b97735b4ac53
2023-09-21 20:28:13 -07:00
James D. Forrester
d1ab762c04 Drop the PersonalUrls hook, deprecated in 1.39
Bug: T319087
Change-Id: I398de94099cf17d071bc539a87a140a76fd301bd
2023-09-21 19:44:12 +01:00
James D. Forrester
c1599c91b3 Namespace Config-related classes under \MediaWiki\Config
Bug: T166010
Change-Id: I4066885a7ea071d22497abcdb3f95e73e154d08c
2023-09-21 05:41:58 +00:00
James D. Forrester
468e69bccc Namespace Sanitizer under \MediaWiki\Parser
Bug: T166010
Change-Id: Id13dcbf7a0372017495958dbc4f601f40c122508
2023-09-21 05:39:23 +00:00
James D. Forrester
3851805f64 Namespace remaining User-related classes under \MediaWiki\User
Bug: T166010
Change-Id: Ibda1e8be0f23c6262a32b607f8260cad36f188fc
2023-09-20 09:12:08 +01:00
daniel
7b8187f257 Introduce ActionFactory::getActionInfo
The new method encapsulates the fact that we currently have to
instantiate action objects to determine which permission the action
requires. This encapsulation reduces coupling in PermissionManager
and allows us to easily change to a better way to create ActionInfo
later.

Eventually, ActionInfo should be constructed based on the action's
object spec. This requires us to include the relevant information in all
specs, in core and extensions.

Change-Id: I707a165c41403ebd4a3edfc66c1595e1bd3a4087
2023-09-20 10:06:02 +10:00
James D. Forrester
1d0b7ae1e2 Namespace User under \MediaWiki\User
Bug: T166010
Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
2023-09-19 19:18:16 +00:00
James D. Forrester
5bc2a04b08 Namespace remaining Title-related classes under \MediaWiki\Title
Bug: T166010
Change-Id: Ia2e5a7367cc8cdbd8a7b845ae2fd5d776ff22891
2023-09-19 05:21:23 +00:00
James D. Forrester
41fb118c5c Namespace TitleParser under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: I4848e903b0c0a2f7c58ac19e0baeef0085a36bdc
2023-09-19 05:19:00 +00:00
James D. Forrester
b16be7a36c Namespace TitleFormatter under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: Ic2d59eb6764b1a273ed7162ecabf641f638b8f66
2023-09-19 05:17:18 +00:00
James D. Forrester
a8a6cfd966 Namespace NamespaceInfo under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: Ibe103cd362535d3cb94cb8931e95fc74099d1497
2023-09-19 05:17:04 +00:00
James D. Forrester
94ece673b2 Namespace TitleValue under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: I4c901d5c32696d8334ec30cede7d9b6f3d8d645e
2023-09-18 18:24:39 +01:00
James D. Forrester
459cbb0494 Namespace remaining 'specialpage' files under \MediaWiki\SpecialPage
SpecialPageFactory is already here, but none of the others were yet.

Bug: T166010
Change-Id: I9689bf0a1ab329625e23669b99f019b96295fffd
2023-09-18 18:23:13 +01:00
James D. Forrester
5088626212 Namespace 'special' Pagers under \MediaWiki\Pager
They're under 'specials' because that's where they're mostly used,
but they're just another kind of Pager (shown by their use outwith
the MediaWiki\Specials hierarchy, which is a bad code smell for us
to review later).

Bug: T166010
Change-Id: Iad3f91582b723c1e6679525aa852ffdfd8c6d5ba
2023-09-18 18:23:13 +01:00
James D. Forrester
b6f263b043 Namespace HistoryPager under \MediaWiki\Pager
Although it's in a different path, it's alone and only Action-related
because that's where it's used.

Bug: T166010
Change-Id: I6d4cebfd6ad68e1500c3a3a5450c97bfd3327c2b
2023-09-18 18:23:13 +01:00
James D. Forrester
3aeb9d681c Namespace core Pagers under \MediaWiki\Pager
Bug: T166010
Change-Id: Ibe12d1754709d48f71edd4cde1f13a542344a21e
2023-09-18 12:27:56 +01:00
jenkins-bot
e114026bab Merge "Add UserRegistrationLookup" 2023-09-15 16:59:54 +00:00
Martin Urbanec
85e78d22bd Add UserRegistrationLookup
Why:
Temporary accounts introduced as part of IP Masking are supposed
to expire 1 year after their registration. Accounts can have
multiple registration timestamps when in a wiki-farm setup,
depending on which wiki we consult.

To implement the account expiration logic, we need to know the global
(first) registration timestamp.

Similar to CentralIdLookup, a concept of a registration date
provider is introduced. Unlike IDs, users can have multiple
kinds of registration dates (Wikimedia recognizes local and global,
but third parties can have different needs). For that reason,
any number of registration providers can be registered at any
given time; caller determines which one is requested. The default
is `local`, which is the only provider that is guaranteed to exist.

What:
* Add UserRegistrationLookup
* Add UserRegistrationProviders config variable

Bug: T344694
Change-Id: If9fa12a392064dd504590a861a175e3604a34fab
2023-09-15 11:38:23 +02:00
James D. Forrester
0c0d8777a8 Namespace SpecialW* under \MediaWiki\Specials
This completes the namespacing of core special pages.

Change-Id: I195e7fc34a9413bfea0a33c941f2362cd4a7ff10
2023-09-15 09:01:31 +01:00
James D. Forrester
870f7c3f1a Namespace SpecialVersion under \MediaWiki\Specials
Change-Id: Ibeb181c653dac3796c44b36c8ff9f2ed572d5f42
2023-09-14 19:25:51 +00:00
James D. Forrester
87f2b083af Namespace SpecialU* under \MediaWiki\Specials
Change-Id: I75b04a7a65f8d37da12d2ed3892e065e97c92437
2023-09-14 19:24:08 +00:00
James D. Forrester
cc4570464c Namespace SpecialT* under \MediaWiki\Specials
Change-Id: Iaab14a0ded4950c5a6dafc2f301792b6546fb15f
2023-09-14 19:23:23 +00:00
James D. Forrester
a6f3c28865 Namespace SpecialS* under \MediaWiki\Specials
Change-Id: Icccdaa93f8089d88b6d3ba153ecfaa22c901ce66
2023-09-14 19:23:14 +00:00
James D. Forrester
ea2979b8ca Namespace SpecialR* under \MediaWiki\Specials
Change-Id: I735222c437313db139cd9fc780c332767189323f
2023-09-14 14:35:03 +01:00
jenkins-bot
99b0d1493d Merge "rdbms: Rename DatabaseMysqlBase to DatabaseMySQL" 2023-09-13 19:29:12 +00:00
James D. Forrester
f17ccb46ae Namespace SpecialP* under \MediaWiki\Specials
Change-Id: I10211c4406b1eedd6e5de63f1e57868f924640db
2023-09-13 14:41:15 +00:00
James D. Forrester
158e6ab5f2 Namespace SpecialN* under \MediaWiki\Specials
Change-Id: I403664ce3585f022e89da75e75baefa4b4db29f9
2023-09-13 12:30:32 +01:00
Amir Sarabadani
5dc9441b1d rdbms: Rename DatabaseMysqlBase to DatabaseMySQL
Now that we merged DatabaseMysqli with DatabaseMysqlBase, there is no
base anymore.

I could have gone with DatabaseMysql, and the naming is not that
consistent in rdbms:
amir@amir-ThinkPad-P1-Gen-3:~/core/includes/libs/rdbms$ find . | grep -i mysql
./platform/MySQLPlatform.php
./field/MySQLField.php
./dbal/MWMySQLPlatform.php
./database/DatabaseMysqlBase.php
./database/DatabaseMysqli.php
./database/position/MySQLPrimaryPos.php
./database/resultwrapper/MysqliResultWrapper.php
./database/replication/MysqlReplicationReporter.php

The majority is MySQL and since it's the correct form, I went with that
instead.

Change-Id: I3ee792f357dda974c855ba24b9b35e72fc73db06
2023-09-13 08:15:08 +01:00
jenkins-bot
7f9538e32a Merge "http: MultiHttpClient supports TelemetryHeadersInterface" 2023-09-12 20:42:27 +00:00
Piotr Miazga
8009e9d027 http: MultiHttpClient supports TelemetryHeadersInterface
Introduce a new interface Wikimedia/Http/TelemetryHeadersInterface
that provides telemetry information that could be attached to
HTTP Requests. MultiHttpClient is expecting `telemetry` option
of TelemetryHeadersInterface type.

The MediaWiki/Http/Telemetry implements the interface, therefore
ObjectCache can inject it to RESTBagOStuff, that further injects
it to MultiHttpClient.

Bug: T344926
Change-Id: I59a3f1048c403fe2e4ef0c74353dfe74ff9ca893
2023-09-12 18:05:17 +02:00
Amir Sarabadani
5bd33d46ef Reorg: Move WebRequest to includes\Request
This has been approved as part of RFC T166010

Bug: T321882
Change-Id: I6bbdbbe6ea48cc1f50bc568bb8780fc7c5361a6f
2023-09-11 21:44:34 +01:00
Amir Sarabadani
82478bd60d Reorg: Move SiteConfiguration to includes/config/
And namespace it to MediaWiki\Config

This should be eventually deprecated and removed but this has been
blocking the reorg for long enough.

Bug: T321882
Change-Id: I7a1a073495469623f6f77e6f74b23b7b4c18033a
2023-09-11 18:43:47 +01:00
jenkins-bot
342b9d4fc9 Merge "rdbms: Introduce ReplaceQueryBuilder" 2023-09-10 23:49:54 +00:00
Timo Tijhof
e56552557f deferred: Decouple DeferredUpdates from MediaWikiServices
* Create task-specific methods with simple defaults that require no
  mocking or stubbing of any kind, as used by the pure unit tests
  where service container (and by extent, storage services) are
  disabled.

* Remove all use of global variables, LBFactory, JobQueue,
  StatsdFactory, and RequestContext.

Bug: T265749
Change-Id: If85c448d2d1b806e70f641f06263680d49c6eeec
2023-09-09 20:42:02 +01:00
Amir Sarabadani
79172aed51 rdbms: Introduce ReplaceQueryBuilder
To replace IDatabase::replace()

Bug: T335377
Change-Id: I446f7a09cfc0ee37c2e016052d452751f7333e27
2023-09-08 11:37:26 +02:00
Amir Sarabadani
2faca8519b Introduce ArchiveSelectQueryBuilder
Similar to RevisionSQB (Ifd690dc8f030)

Bug: T344971
Change-Id: Ic520bcf09f4cc95ebd6a3990cff46dec5b7cd350
2023-09-07 17:03:22 +02:00
Amir Sarabadani
049b34b41c Introduce RevisionSelectQueryBuilder
Deprecating RevisionStore::getQueryInfo() and cleaning up a lot of code

Also removing a brittle test that wasn't really testing anything.

Bug: T344971
Change-Id: Ifd690dc8f030f86e3567a717eaeb830cb6dc703b
2023-09-06 12:30:38 +02:00
Amir Sarabadani
d8e542abf9 Reorg: Move three output related classes to includes/Output/
And namesapce them:
 - StreamFile
 - OutputHandler
 - OutputPage

Bug: T321882
Change-Id: Iedf8d88c595e580f2d8f0734c92aa5c45618ba33
2023-09-05 19:36:42 +01:00
Amir Sarabadani
e5eda1c358 Schema: Drop old externallinks columns and indexes
Already dropped from production

Also dropping FixExtLinksProtocolRelative as it's not useful anymore and
it has been run in previous releases so it's not worth fixing.

Bug: T312666
Change-Id: I1dd6e704b34e685ada6e316da11243d10827d769
2023-09-05 15:32:23 +02:00
jenkins-bot
ebf31d3149 Merge "Merge CommentStoreBase into CommentStore" 2023-09-04 15:05:24 +00:00
Gergő Tisza
7a21b9a032 Add UserGroupManager::getUserPrivilegedGroups()
This moves the core part of wfGetPrivilegedGroups() out of Wikimedia
config and makes it possible to move functionality built on it into
core.

Bug: T208477
Change-Id: I6536ef2909caeed047447e8b6a25831d6f00d827
2023-09-02 11:59:25 +00:00
Alexander Vorwerk
4a4d9e2621 Merge CommentStoreBase into CommentStore
Bug: T343558
Change-Id: I74cd68b7689f750d9300141575506910878f1802
2023-09-01 12:17:14 +02:00
Derick Alangi
68ccccfe0c
searchwidgets: Remove SimpleSearchResult(Set)Widget.php
This class was hard deprecated in 1.31 and is no longer used anywhere
per else after last usage.

See: https://codesearch.wmcloud.org/search/?q=%28SimpleSearchResultSetWidget%7CSimpleSearchResultWidget%29&files=&excludeFiles=&repos=

Change-Id: I6b4ecef871248e9978ee7afc1bd27de364525552
2023-08-31 16:12:43 +01:00
jenkins-bot
f071c22a9a Merge "rdbms: Drop old class aliases" 2023-08-29 10:47:27 +00:00
Amir Sarabadani
f4e68e055f Reorg: Move Status to MediaWiki\Status\
This class is used heavily basically everywhere, moving it to Utils
wouldn't make much sense. Also with this change, we can move
StatusValue to MediaWiki\Status as well.

Bug: T321882
Depends-On: I5f89ecf27ce1471a74f31c6018806461781213c3
Change-Id: I04c1dcf5129df437589149f0f3e284974d7c98fa
2023-08-25 15:44:17 +02:00
James D. Forrester
447400b423 rdbms: Drop old class aliases
Bug: T344536
Depends-On: I565541d781caaf564ae0c1877f5cb086e3650f22
Depends-On: Ia5fdf3242f9510e4f21670f3746d9364ae2935c6
Depends-On: I6f4b158bdc3ef20a1660e66accca0ffc17104f49
Change-Id: Ia87f1be7e0e68eb7cf792cb1f5ae64ecdfa2c015
2023-08-24 15:18:13 -04:00
jenkins-bot
484a95eaa8 Merge "Reorg: Move GitInfo to utils/" 2023-08-23 16:18:29 +00:00
Derick Alangi
ae8c71feae deferred: Drop support for DeferredUpdatesManager
Revert of I7f07eddf2fc399b15db4fe9be4c792ef8eb0747b.

Bug: T265749
Change-Id: I5ab08bda82a79a518dd508383c60863d73cfdac4
2023-08-21 22:57:41 +00:00
Amir Sarabadani
cb7351809e Reorg: Move GitInfo to utils/
Bug: T321882
Change-Id: Ibd8aff5f57555d5b2a3b9cd121c8919a5a96d313
2023-08-21 18:35:32 +02:00
Amir Sarabadani
c822159cb4 Reorg: Move ExtensionInfo to utils/
Bug: T321882
Change-Id: I5d0539821ded4ed9f2698ecbc76c2678612f1c97
2023-08-19 11:15:34 +02:00
Amir Sarabadani
15a278189f Reorg: Move MWTimestamp to MediaWiki\Utils
Bug: T321882
Change-Id: I48c10343295c4eb3d9ef8037343b0070e928f040
2023-08-19 05:53:40 +02:00
Amir Sarabadani
64a3552a40 ResourceLoader: Completely remove FileCache
When I was testing for caching in RL, I realized file cache is
completely broken and mostly useless, specially for not taking into
account new query parameters and thinking basically all RL modules are
uncachable.

Let's just remove this.

Bug: T330576
Change-Id: I5b17bfc4c5543bd0e96e1099c87341ddf8fd6572
2023-08-11 13:50:41 +02:00
jenkins-bot
e9da71ed5f Merge "rdbms: Merge DatabaseMysqli into DatabaseMysqlBase" 2023-08-08 22:15:00 +00:00
jenkins-bot
91e4316330 Merge "objectcache: Remove IExpiringStore interface" 2023-08-08 20:31:46 +00:00
Derick Alangi
2abbb1a774 objectcache: Remove IExpiringStore interface
Interface was deprecated since 1.35 in favor of ExpirationAwareness
or StorageAwareness interfaces. No longer used anywhere, see dependent
patches.

Depends-On: Ida557b3180eb5e7ebae46968142b4f154f26ffbc
Depends-On: I3d6fbf535560655472ade27c37b0e42b3e11a535
Depends-On: I2b0a669d41d9e6a8a859cba314c0e9e4c0ef40d7
Depends-On: I776040c2c8f61e25ae986e93bb1975fdd8bf9dd5
Change-Id: I9c5ffa9f51aec6356e3e27458fd098a37cd754ad
2023-08-08 20:15:03 +00:00
jenkins-bot
bd2e830346 Merge "Introduce FileSelectQueryBuilder" 2023-08-08 10:52:48 +00:00
jenkins-bot
49cb8edc37 Merge "http: Propagate tracestate and traceparent headers" 2023-08-08 01:07:08 +00:00
Piotr Miazga
67c1e15469 http: Propagate tracestate and traceparent headers
Introduce a Telemetry singleton for propagating `tracestate` and
`traceheaders` during a MW web request. This class allows for easier
testing and mocking.

In the future we might use this as a wrapper for OpenTelemetry.

Bug: T320559
Change-Id: I3e5e54afa21f8c099877b3765c769f2d2f8f5d61
2023-08-07 21:04:19 +00:00
Amir Sarabadani
291258adfd rdbms: Merge DatabaseMysqli into DatabaseMysqlBase
This should have been done long time ago.

Change-Id: I4935b0483a566266e5bc99542478387304843624
2023-08-07 20:37:09 +02:00
Amir Sarabadani
e569aedde5 Introduce FileSelectQueryBuilder
So much can be cleaned up with this

Bug: T311866
Change-Id: Ia4d46679c540c731b2ae8da2f8022fd6f5b931a4
2023-08-07 19:05:34 +02:00
Amir Sarabadani
974313663a Reorg: Move ProxyLookup to Request/
It's basically only used there.

Bug: T321882
Change-Id: Ibd9cac69772270b50152572ed618c692bbd5e4d9
2023-08-06 12:22:58 +02:00
Fomafix
e340624ae0 Add new maintenance script cleanupPageLang.php
This script replaces deprecated language codes in page_lang.

A run of this script is needed after a language code change on projects
with $wgPageLanguageUseDB = true.

Change-Id: I8a9f26effbcf0412bcc679219ab690ef5c6d35a4
2023-08-05 13:12:42 +00:00
jenkins-bot
ae38b1c09f Merge "Acquire a temporary user username before previewing" 2023-08-01 01:19:58 +00:00
Bartosz Dziewo?ski
ccbd669d83 Acquire a temporary user username before previewing
* Add an API action=acquiretempusername
* Add a mw.config variable with the temp user name
* Add mw.user.acquireTempUserName, which checks the mw.config
  variable, then fetches a name from the API
* Use mw.user.acquireTempUserName when previewing

Bug: T331397
Change-Id: Iec8a15dadd595bed0f7e54f907fbb8e192b45cf3
2023-07-31 10:48:20 +02:00
C. Scott Ananian
ea51801f79 Rename newly-added ParserOutput::appendOutputString() method
Tweaked the pluralization of the newly-added
ParserOutput::appendOutputString() method (now ::appendOutputStrings()
and ::getOutputStrings()), and name of the ParserOutputStrings class
(now ParserOutputStringSets), in an effort to continue repainting
bikesheds until the color is juuuust right.

Also extended the new method to cover ::addModules() and ::addModuleStyles()
and added support for these string sets in ::collectMetadata().

(These methods and the enumeration class were originally added in
b2cfa31eb6173e9f5e8607eadd126c33f8ce440b.)

Depends-On: I8bdffa55498d90e990af5bfc3332e3028b0a3539
Change-Id: Ibd41485d5db7779f01642e2144c50ed49d409812
2023-07-28 12:10:56 -04:00
jenkins-bot
23bcbf944f Merge "Add append/getOutputString to ParserOutput" 2023-07-27 17:34:21 +00:00
Isabelle Hurbain-Palatin
b2cfa31eb6 Add append/getOutputString to ParserOutput
This aims at providing an interface similar to setOutputFlag for string
sets, such as the ones used in CSP properties.

Change-Id: I6f103bd88802e66611e483403a2f8a540d54aae9
2023-07-27 11:37:11 +02:00
jenkins-bot
c16fae21f5 Merge "rdbms: Introduce InsertQueryBuilder" 2023-07-25 14:49:01 +00:00
Tim Starling
31e3fd4329 Add UserIdentityUtils service
Add a service for convenient interpretation of UserIdentity instances,
especially relating to the TempUser migration.

Bug: T341976
Change-Id: I94e8620cd3187f41f04cdf24b5b553baadfbc22d
2023-07-24 09:52:10 +10:00
Tim Starling
2aa87cdf2c Factor out TextDiffer hierarchy from TextSlotDiffRenderer
* Follow the TODO comment in TextSlotDiffRenderer
  ::getTextDiffInternal() by moving the code out to three parallel
  implementations, namely ExternalTextDiffer, PhpTextDiffer and
  Wikidiff2TextDiffer.
* Add a container/factory class ManifoldTextDiffer to glue them
  together and collate available formats.
* Move the inline legend to Wikidiff2TextDiffer. Not the toggle since
  the ability to toggle depends on the available format, not the current
  format.
* Update the diff cache keys so that ManifoldTextDiffer can store the
  engine=>format map it used to generate the diff.
* Drop support for the second parameter to TextSlotDiffRenderer
 ::setEngine(), since nothing used it anymore.
* Provide a format batch API, since some engines are able to efficiently
  generate multiple formats. This might be used by DifferenceEngine in
  future.

Needs risky change notification for the cache key change.

Bug: T339184
Depends-On: I8a35b9b8ec1622c9a36d2496bdd24f51bc52c85f
Change-Id: I5c506e39162855aff53dd420dd8145156739059c
2023-07-19 12:38:18 +10:00
Lucas Werkmeister
3c5a0c862f Html: Move encodeJsVar() + encodeJsCall() from Xml
These methods really belong in the Html class, not Xml. Leave behind
soft-deprecated Xml methods that forward to the Html ones, as well as a
class alias for HtmlJsCode (renamed from XmlJsCode).

Bug: T341779
Change-Id: I99a5f9de1411d4eb5ee30226b4e8ace3ea8b2c3b
2023-07-14 13:42:02 -04:00
Bartosz Dziewoński
25b40324f1 Remove SpecialPageAction and associated logic, route old URLs
Bug: T323338
Change-Id: I115ace5e82f55fd6652d61f05926e96ba569a8a9
2023-07-11 19:22:51 +00:00
Amir Sarabadani
d95a6b3167 rdbms: Introduce InsertQueryBuilder
Bug: T335377
Change-Id: I6e8a4ac0bdeaa1a4bd363190089dfc0f95f88ec6
2023-07-11 15:49:11 +02:00
Jon Robson
51c6fe6167 Login page: Use Codex CSS components
Changes:
* Use Codex markup instead of mediawiki ui markup
* We limit what can be customized by the skin
* Current rules for touch area and snapping of
inputs is moved from Minerva into core so other skins
benefit from the styling
* A placeholder text is adding to the "real name" field.
* Introduce CodexHTMLForm

Bug: T182050
Change-Id: I834cc0e07fc1e705753df6866a5eeda2ac77fb8e
2023-07-06 17:20:17 -07:00
thiemowmde
99230a7f72 Fix backwards compatibility alias for WordAccumulator
This was a mistake in I892364b. Unfortunately the codebase was in a
confusing state with many classes in no namespace. But this class was
in one.

Bug: T339184
Change-Id: Id31b9f53ffb6483c1901db8ab26fcb40368ec074
2023-06-26 16:30:51 +00:00
jenkins-bot
db8c4b0699 Merge "Improve handling of diffs between incompatible content models" 2023-06-26 01:06:58 +00:00
Gergő Tisza
a9e0562cfb Improve handling of diffs between incompatible content models
When the old and new content object for a slot cannot be compared,
show an error message for that slot only, instead of throwing an
exception.

Bug: T214217
Change-Id: I6e982df358f85ca78f0448b3a93ded3f40676310
2023-06-23 19:09:59 +00:00
jenkins-bot
8647f03800 Merge "Convert PageRedirectHandlerTrait to PageRedirectHelper" 2023-06-23 13:05:51 +00:00
jenkins-bot
923cbd131c Merge "Add maintenance/storage/fixLegacyEncoding.php" 2023-06-22 23:27:24 +00:00
Amir Sarabadani
bad7b08883 Add maintenance/storage/fixLegacyEncoding.php
To fix legacy encoding entries in external storage which means they
can't be fixed via calling moveToExternal.php.

The script originally was copy-paste and clean up of moveToExternal.php
but it made so much duplication that I went with subclassing.

Bug: T282734
Change-Id: Ic52e843f3dbe7d14cc8df5e8f3fe7aada7681bc9
2023-06-22 09:59:01 +02:00
Ammarpad
b6becee5eb Remove deprecated SkinTemplateNavigation hooks
- SkinTemplateNavigation hook
 - SkinTemplateNavigation::SpecialPage hook

Bug: T339969
Change-Id: I0aa4a593ae5c795ca2f75234f379e5ad0efa48aa
2023-06-21 23:20:01 +01:00
jenkins-bot
de6ea8d050 Merge "Populate parser cache with parsoid output." 2023-06-21 15:14:07 +00:00
daniel
5bc235c966 Convert PageRedirectHandlerTrait to PageRedirectHelper
Using a helper object instead of a trait allows for dependency
injection through PageRestHelperFactory. This will make it easier to add
language variant redirects in the next step.

Change-Id: I1d4f26c380797e28e1b97051400bb9b1301b89ab
2023-06-20 21:15:24 +02:00
jenkins-bot
bdb701a634 Merge "Move DiffEngine and helpers to includes/libs/Diff and put them in a namespace" 2023-06-20 19:03:46 +00:00
rrana-wmf
5488772c5f Populate parser cache with parsoid output.
The --force option is supported. NOTE: Without supplying any
arguments/options, the script will run for all pages in the wiki.

TODO: Run for all pages in batch sizes, so things don't explode
      if we have so many pages.

Bug: T338922
Change-Id: Id894f4769ad6f20137b13143178f50f227d7481a
2023-06-20 14:45:42 +03:00
jenkins-bot
b63c42015c Merge "mail: Round 6 of EmailUser refactoring" 2023-06-20 11:23:50 +00:00
Daimona Eaytoy
c7eb0db5d1 mail: Round 6 of EmailUser refactoring
- Rename methods to follow the more standard convention used for
  commands.
- Update doc comments.
- Add new hooks with final method names and parameter types, to replace
  the old messy hooks.
- Deprecate the remaining old hooks.

Bug: T265541
Change-Id: I609709a70fb58ce00b9f179ee4de2f6ac5e0a1cf
2023-06-20 11:00:07 +00:00
Tim Starling
5127bb2f78 Remove RangeDifference
RangeDifference was introduced in 89f8141a7 (2008) by Guy Van den
Broeck as part of his experimental "wikidiff3" engine.

Wikidiff3 was mostly removed in dcac5f19 (2009), although the Wikidiff3
class itself remained until 20f066e97 (2016) when it was merged into
DiffEngine. The merge left diff_range() as an unused method with no
visibility modifier being the only caller of RangeDifference. "private"
was eventually added, and then finally the unused private method was
deleted, leaving no callers in core or extensions.

Change-Id: I11fd03b9b36449620518b94e2c4be02da32d1271
2023-06-20 10:53:39 +00:00
Tim Starling
359ce91a12 Move DiffEngine and helpers to includes/libs/Diff and put them in a namespace
I will address the dependencies on MW core in a followup.

Bug: T339184
Change-Id: I892364b0c9f15c9de4cfc29c683670c172d71764
2023-06-20 15:15:13 +10:00
jenkins-bot
b48bfcdb85 Merge "Create new TempUserBanner skin component" 2023-06-16 17:33:49 +00:00
Jan Drewniak
62196c2fa1 Create new TempUserBanner skin component
Creates a new skin component for informing users with
temporary accounts that they can login or register if they choose.

Adds:
- New skin component: SkinComponentTempUserBanner.php
- Skin feature: "temp-user-banner"
- Associated styles
- New i18n messages for banner

NOTE: This component is not registered via the skinComponentRegistry
because it doesn't output any data, only a string of HTML.
Instead it is appended to the body element before the skin is rendered.

Bug: T330510
Change-Id: I1e137dbd29f3c73efac901f43f8a8258e2a111fc
2023-06-16 16:50:06 +00:00
jenkins-bot
c1c4fe771a Merge "Make some storage scripts use Maintenance class" 2023-06-16 02:52:40 +00:00
daniel
34d73531cb Make some storage scripts use Maintenance class
CommandLineInc is deprecated. This allows the scripts to be executed
from MaintenanceRunner.

Change-Id: I180605ea5cb47783670b28a6f01d98f0398c705d
2023-06-14 22:36:35 +02:00