Commit graph

8854 commits

Author SHA1 Message Date
Translation updater bot
9530b23ee3
Localisation updates from https://translatewiki.net.
Change-Id: I7c5c2921596e509850cfa828ff4da00e9fbb6ea0
2025-01-14 06:31:37 +01:00
Translation updater bot
cacd3b793b
Localisation updates from https://translatewiki.net.
Change-Id: Ie051918d63ba73144f9a47c262cff016a9da4b88
2025-01-07 06:33:31 +01:00
Translation updater bot
91e434b9ba
Localisation updates from https://translatewiki.net.
Change-Id: I407e678d3272356af61f1aa4501da649e579c42f
2024-12-31 06:32:17 +01:00
Translation updater bot
0974f58a47
Localisation updates from https://translatewiki.net.
Change-Id: I990c03920d6eea71c57cd642fd257d959d328e79
2024-12-24 06:31:59 +01:00
Translation updater bot
28a23b6c17
Localisation updates from https://translatewiki.net.
Change-Id: I3bc5b5e1cf102d5de24e18e207ded1a1eb386c7c
2024-12-17 06:32:12 +01:00
Translation updater bot
243674529e
Localisation updates from https://translatewiki.net.
Change-Id: I63a0d567bfa65b73120645bc5820be2321b6d84f
2024-12-10 06:31:11 +01:00
Translation updater bot
c149a70c0e
Localisation updates from https://translatewiki.net.
Change-Id: Iee6d9a093d36164b67739c76651500c6eff23414
2024-11-26 06:31:54 +01:00
Translation updater bot
d5a793d5a2
Localisation updates from https://translatewiki.net.
Change-Id: Ide69282dbb21c4f1bb12e5ad90444472711cbf19
2024-11-19 06:32:07 +01:00
Translation updater bot
21eaa87821
Localisation updates from https://translatewiki.net.
Change-Id: Ifd10ef063d76695c30c0bc703b955d5c96c2430b
2024-11-12 06:32:03 +01:00
Umherirrender
1b29f07440 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
2024-10-21 20:41:20 +02:00
jenkins-bot
cd7a5998e9 Merge "Make Message and MessageValue compatible" 2024-10-21 15:38:56 +00:00
Translation updater bot
8f3de71b9d
Localisation updates from https://translatewiki.net.
Change-Id: I470b03c872979240806dfd4db6d1b6ca8284a263
2024-10-21 09:01:48 +02:00
jenkins-bot
0adbc57f7b Merge "api: Check for post_max_size on api requests" 2024-10-19 21:59:39 +00:00
jenkins-bot
058b501166 Merge "api: Use type-declaration for string arg in ApiBase::__construct" 2024-10-19 21:52:22 +00:00
Bartosz Dziewoński
9d56257d8c Make Message and MessageValue compatible
Fix two problems that made it difficult to convert between Message
and MessageValue, or to write code that could accept both of them,
as exemplified by the StatusValue class:

* Implement a common interface
* Use the same internal format for message parameters

While these changes should be compatible with most of existing code,
where the authors were courteous enough to simply call methods such
as Message::numParam() and not look inside the values they return,
it is potentially a breaking change for anything that depended on
the formatted params being arrays or accessed their keys.
Example patches: https://gerrit.wikimedia.org/r/q/topic:message-param

Notable changes:

* Message and MessageValue now both implement MessageSpecifier
  (only Message implemented it before).

* Message::numParam() and other static methods for encoding params
  now return MessageParam objects, instead of special arrays.
  Use these MessageParam objects internally in Message.

* Narrow down the return type of MessageSpecifier::getParams() (it
  was just `array`, allowing any type in the array). Narrow down the
  types for Message::params() and MessageValue::params() to match.

* Deprecate MediaWiki\Message\Converter. As a replacement add
  MessageValue::newFromSpecifier(), which is analogous to
  Message::newFromSpecifier(), but without weird legacy edge cases.

* Make StatusValue::getMessages() return MessageValues. Remove code
  that converted between Message and MessageValue, no longer needed.

* Update many type declarations and comments to use MessageSpecifier
  instead of MessageValue, as well as a couple of tests that depended
  on implementation details.

Bug: T358779
Change-Id: I625a48a6ecd3fad5c2ed76b23343a0fef91e1b83
2024-10-19 15:00:07 +02:00
C. Scott Ananian
d6d6343c68 Deprecate OutputPage::{get,set}PreventClickjacking()
This is redundant with the same-named methods on ParserOutput.

Bug: T301020
Change-Id: I60455186e3a6e9b4329ff09e2f7ea920e2e05192
2024-10-17 23:51:39 -04:00
Umherirrender
be1c33e05e api: Check for post_max_size on api requests
php documentation:
If the size of post data is greater than post_max_size, the $_POST and
$_FILES superglobals are empty.

When the action= and format= are not in the GET data,
the help page is returned in html, breaking the clients expected format.

Return api error with http status 413

Bug: T291754
Change-Id: I5906fb6b4412b161b198df0b51e2476e7e1079b8
2024-10-17 18:22:41 +00:00
Umherirrender
1145328459 api: Use type-declaration for string arg in ApiBase::__construct
Also for all sub-classes
Remove simple doc-blocks without further information

Change-Id: I981934efe32d44f52e5ab865a9b887be5bd0f41e
2024-10-17 20:09:15 +02:00
Translation updater bot
51c6df1cc4
Localisation updates from https://translatewiki.net.
Change-Id: I7845b834d7497f34569961c94a2e02845c4d431d
2024-10-17 09:04:59 +02:00
jenkins-bot
abc8da60be Merge "Use explicit nullable type on parameter arguments" 2024-10-16 23:10:14 +00:00
Umherirrender
e662614f95 Use explicit nullable type on parameter arguments
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead

Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a

Break one long line in SpecialPage.php

Bug: T376276
Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
2024-10-16 20:58:33 +02:00
James D. Forrester
e7db78e8d6 Replace uses of deprecated ChangeTags static methods
Bug: T360664
Change-Id: I3363a225e54bb2cae01ba066d432a8b7b21933d2
2024-10-16 13:30:12 -04:00
James D. Forrester
a5387c7c20 Namespace all remaining classes in includes/parser
Bug: T353458
Change-Id: If02cc9b1ff78e26c1cf8c91ee4695845eb133829
2024-10-15 23:54:32 +01:00
Translation updater bot
b38604c108
Localisation updates from https://translatewiki.net.
Change-Id: I26fea4413f6d54e2e272f0498cf28649df2ef815
2024-10-15 09:07:29 +02:00
Translation updater bot
3ecaf9436f
Localisation updates from https://translatewiki.net.
Change-Id: Idd6c1af12f5e3c6e109dc07c9288d21ec3de9dcf
2024-10-14 09:04:59 +02:00
jenkins-bot
c3ed3b7e39 Merge "Add systemuser param to Users API List result to flag system user accounts" 2024-10-11 22:30:50 +00:00
jenkins-bot
dbe8c4b9aa Merge "WebRequest: Deprecate parameter $default in getRawVal" 2024-10-10 15:05:35 +00:00
Translation updater bot
16fe2c9d33
Localisation updates from https://translatewiki.net.
Change-Id: I6545bb71c0f803e471f38894057e806029d2df6e
2024-10-10 09:04:36 +02:00
Translation updater bot
db7e41ad76
Localisation updates from https://translatewiki.net.
Change-Id: I5b553e46652ce409459e85675c40982fc61c12f2
2024-10-07 09:05:49 +02:00
jenkins-bot
c09ac42243 Merge "build: Use inline ignore for MediaWiki.Usage.DeprecatedGlobalVariables" 2024-10-05 15:59:19 +00:00
Translation updater bot
57557de55b
Localisation updates from https://translatewiki.net.
Change-Id: Ia703419c4c3b16ca0e0b8559a23ac5697e3ada03
2024-10-04 09:04:00 +02:00
Fomafix
9208216d6b WebRequest: Deprecate parameter $default in getRawVal
Use
	$request->getRawVal( 'key' ) ?? 'default'
instead of
	$request->getRawVal( 'key', 'default' )

The ?? is more flexible, avoids a wrong type detection by phan and
avoids the evaluation of the default value if not needed.

Bug: T376245
Depends-On: I3ed6b85c0d117ed7cb3a8b79f73a3eb42977891e
Change-Id: I8b02f9297b76d04e21f8cb9194f3b85631956eca
2024-10-03 15:49:33 +00:00
Translation updater bot
deb17dd37d
Localisation updates from https://translatewiki.net.
Change-Id: I2da1c66137b9e9cc65198c0bbdbce93fca04642d
2024-10-02 09:08:32 +02:00
Translation updater bot
bc9e19336a
Localisation updates from https://translatewiki.net.
Change-Id: I69596a668d82e3a7fa453894e0d43019fe3bbdb3
2024-10-01 09:05:30 +02:00
jenkins-bot
0921ef1b49 Merge "Add @phan-mandatory-param for function name arguments" 2024-09-30 16:51:33 +00:00
Translation updater bot
e7efa029d2 Localisation updates from https://translatewiki.net.
Change-Id: I6d82a827e20d18ff4d78d7351aa9e9c08129e400
2024-09-30 07:46:10 +00:00
jenkins-bot
315de0e434 Merge "Deduplicate language links in ParserOutput and OutputPage" 2024-09-27 22:43:43 +00:00
James D. Forrester
9e5c1e8ac7 Add namespace to IDBAccessObject and DBAccessObjectUtils
Bug: T353458
Change-Id: I23cf7991f8792d4d000d1780463d8ce76dc0aee0
2024-09-27 16:19:10 -04:00
Translation updater bot
1ec2185a55
Localisation updates from https://translatewiki.net.
Change-Id: Id0b4be4017b5ca34a72d2d9c251dc6adc75ba7fe
2024-09-27 09:00:55 +02:00
C. Scott Ananian
7495f9bc15 Deduplicate language links in ParserOutput and OutputPage
Move deduplication of language links out of Parser.php and into the
ParserOutput in order to be compatible with alternate Parsers (Parsoid).
Clean up various inconsistencies: ensure deduplication also happens in
OutputPage when multiple ParserOutputs are merged into the final output,
and ensure that the deduplication in LinksUpdate is done in the same
order (first link prevails) as in Parser/ParserOutput/OutputPage.

Deprecate OutputPage::setLanguageLinks() (the matching
ParserOutput::setLanguageLinks() was deprecated in 1.42).

As a breaking change, return an array, not an array *reference*, from
ParserOutput::getLanguageLinks().  This allows us to safely modify the
internal representation of language links. As far as I can tell, no one
used the returned reference to sneakily modify the list of language
links, and there not a good way to have deprecated this before making
the breaking change.

While we're at it, we've added tests to ensure that language link
fragments are preserved.

Bug: T26502
Bug: T358950
Bug: T375005
Change-Id: I82a05a51d94782ebb9fa87ff889ca0f633b3e15c
2024-09-26 15:28:49 -04:00
Umherirrender
c7cd5399e7 build: Use inline ignore for MediaWiki.Usage.DeprecatedGlobalVariables
This avoids addition of new code with the deprecated global,
or at least it gives extra attention on review when new code also uses
the inline ignore

Change-Id: I5c1bc5a1685c28f153d4fbe3525959930f54b557
2024-09-26 18:15:32 +00:00
James D. Forrester
984076f98e Add namespace to includes/api classes
Bug: T353458
Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
2024-09-25 19:31:14 +00:00
Translation updater bot
54cbffffec
Localisation updates from https://translatewiki.net.
Change-Id: Iecf2de76786a72d4757b4a8db1aede8dea02920b
2024-09-25 09:01:40 +02:00
Translation updater bot
bc72d5b4f7
Localisation updates from https://translatewiki.net.
Change-Id: I88440f316b69c1196f0ad19f4aa1a826f0a02d84
2024-09-23 09:04:37 +02:00
Umherirrender
f910edce6d Add @phan-mandatory-param for function name arguments
Providing the function name is often optional from the php code,
but it is needed for better logging, so make it mandatory and let phan
report issues about this.

Bug: T374546
Depends-On: Iaed5489a85a5a6e685829e151436afc94310fbd0
Depends-On: Ie2a1e5052e5b61bbb5b89905de942f47d3f1413d
Change-Id: I5227f2fa65850ac8c6f620900f22d1f4e7bfd470
2024-09-20 16:23:17 +00:00
Translation updater bot
1f2a0fe3f4
Localisation updates from https://translatewiki.net.
Change-Id: I1f2e02ee4b6de6c5e18ea0a23f9a203b4e312999
2024-09-20 09:03:52 +02:00
jenkins-bot
9ad13c2812 Merge "Update user widgets to support named and temp account exclusion" 2024-09-19 10:07:25 +00:00
Bartosz Dziewoński
7b212efcac Replace some manual checks and exceptions with type hints
Noticed while reviewing I2e640b9737cb68090a8e1cb70067d1b74037d647.

Change-Id: I9b95b56ffd64cc438d5071046a9f038e4d3dc799
2024-09-17 21:33:08 +00:00
Adam Wight
188d2cbbb0 Remove unchecked exception annotations
Callers should not catch an unchecked exception, so it doesn't belong
in a function signature.  Unchecked exceptions indicate a coding error,
which by definition the code will not be able to handle correctly.

If any of these exceptions were supposed to be in response to an edge
case, user input, or initial conditions, then they should be changed
to a runtime error.  If the exception class cannot be changed, then
the annotation should include a comment explaining its purpose and
prognosis.

Bug: T240672
Change-Id: I2e640b9737cb68090a8e1cb70067d1b74037d647
2024-09-17 22:20:58 +02:00
jenkins-bot
78a48b9a45 Merge "ApiParse: don't reparse language link titles" 2024-09-17 03:31:40 +00:00