Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: Id75cb2e5fbee0fe7600f92473d876f23730d46b7
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: Ic4d4dd61de5ab896fb6173eb579c81f164a1e4a3
This patch introduces a namespace declaration for the
MediaWiki\Debug to DeprecationHelper and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I808c6aa7836445feaa7b401624d79d01f2c70322
The mobile site has traditionally shown the patrol link to all
mobile users.
The diff HTML is updated to allow skins to have opinions on whether the
patrol link is displayed or not. By default it is hidden which is the
status quo.
Bug: T357213
Change-Id: I71eed29aed22b79367286c1761cf744a83609967
* Switch out raw Exceptions, mostly for InvalidArgumentExceptions.
* Fake exceptions triggered to give Monolog a backtrace are for
some reason "traditionally" RuntimeExceptions, instead, so we
continue to use that pattern in remaining locations.
* Just entirely give up on PostgresResultWrapper's resource vs. object mess.
* Drop now-unneeded false positive hits.
Change-Id: Id183ab60994cd9c6dc80401d4ce4de0ddf2b3da0
Some less trivial cases. Also update variable names.
This doesn't really change anything, but I hope it helps promote
getConnectionProvider() as the common way to do this.
Follow-up to 8604c384f6.
Change-Id: I6657d783375fac5c7fa856b884ff1fb09285e94c
Changes to the use statements done automatically via script
Addition of missing use statements and changes to docs done manually
Change-Id: I443aada1c18c8628b02671aa9fd6f441961e5c2e
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
This is more useful for JavaScript clients.
Follow up to 7f554fc74
The diff timestamp is also moved to its own HTML element
to account for hidden revisions.
Bug: T240624
Change-Id: Ie8ac1aab6d2fe5f4575a6891c36efe497458e093
This will be used to consolidate the mobile and desktop diff
pages. This useful information could also be incorporated into
desktop skins at a future date.
Bug: T347779
Change-Id: If1f6f75ea829e8754fc51c7c15a2f47ad16dba52
Some of these comments are more than 20 years old. Almost all of them
are copy pasted from somewhere else, most certainly without knowing
what they mean. I can only guess that they have been part of some
ancient code folding feature that's not supported any more. Even if,
almost all of them are misplaced by now because the surrounding code
changed without updating the comments.
Change-Id: I53c37f050574a530ec772b7a07b67d84b31bb7a0
Having these controls in the diff makes it very difficult to
adapt the diff page for mobile screens. It is proposed we add
links at the top of the diff page, that are initially hidden.
These will initially be used in Minerva skin and possibly
upstreamed at a later date for all skins.
Change:
* Add previous / next breadcrumbs at top of diff page
Bug: T347780
Change-Id: Iae6c140cde54d807204e6d2b8c7b6599f75df89e
Adds new regex in BaseTextDiffer::localizeLineNumbers() to work with
wikidiff2 inline diffs as well as table diffs.
Since there are no "columns" in inline mode, we have a new message to
indicate how the line numbers changed from the old diff versus the new.
Deprecate DifferenceEngine::localiseLineNumbers() as no longer used and
redundant to BaseTextDiffer::localizeLineNumbers().
Bug: T346460
Change-Id: I7b195879b677e2242ad73070fe19ad82121576a8
Remove hardcoded parentheses in favor of CSS pseudo elements to
support different display in different skins.
There should be no visual change in any skin with this change.
Bug: T117279
Change-Id: Iaea122647893acfa405d413e851e14949fb4b8d3
The Minerva skin renders a relative timestamp.
Having this data attribute available will allow the Minerva
skin to render a relative timestamp on this page.
Bug: T117279
Change-Id: Ib66de95bdeca6e9bfa082889f0ed0740dbf8639f
Having a different class on the diff allows different styling
in the different contexts.
Bug: T117279
Change-Id: I32fc945dac113453351c07bd75fbf2835e616ce2
CVE-2023-PENDING
reduce the edit count if a user for a given revision is suppress-deleted
Bug: T341529
Change-Id: I79539464cf3500065cb4f42e1542ff5feec31395
These are the same as taint-check's MediaWikiSecurityCheckPlugin.php.
The notable exception is methods in WebRequest that were previously
hardcoded as returning a safe value. This was a consequence of said
methods return safe types (e.g., int, bool). Instead of adding
taint-check annotations, add return typehints instead, which let
taint-check remove any taintedness.
Fix some taint-check issues that were previously not spotted or whose
suppressions were removed in other patches.
Also fix the following bugs spotted by phan thanks to the type hints:
- SpecialExport did not have explicit handling of null $depth, and just
returned 0 because null fails both the < and the > comparisons.
- Improve documentation of params and props in ProtectedPagesPager.
SpecialProtectedPages can pass null $namespace and $size.
- Remove unused parameter from SpecialProtectedPages::showOptions, of
which $ns and $size were not documented as nullable.
- Add FIXMEs in SpecialVersion about very inconsistent escaping.
Bug: T321806
Change-Id: I726f528856614c92329683a0ad8936a42e262748
Passing a Message argument to OutputPage::setPageTitle() is
deprecated, because the message is not properly HTML-escaped by
default. Use ::setPageTitleMsg() instead wherever the message doesn't
include HTML metacharacters.
Also protect arguments with Message::plaintextParams() where
appropriate.
Bug: T343994
Bug: T343849
Change-Id: Iba67d008545249772c136c5d6d302110516d3b94
A unique index on ar_rev_id was added in T193180 (2019), allowing
revisions of deleted pages to be reliably looked up by just their ID.
Use the improved getArchivedRevisionRecord() method in a few places
that previously had to use manual queries.
Bug: T251066
Change-Id: I9352f64952ac4b803d76e9e72f88a01be7317c56
Have Article opt in to inline toggle switch display, so that random
callers of DifferenceEngine::showDiffPage() do not receive a
non-functional format selector.
Bug: T342158
Change-Id: Id4e38c2a20b5381e5f70b1244304da2895eaf8e7
* Add an API-only user preference for diff type
* Retain query parameter stickiness but fix it so that the diff-type
from user preferences does not leak into the query string. So the
no-JS control continues to work. If a no-JS user has the inline
preference set, respect it on the initial load, but add an explicit
diff-type=table to the query string of the table link so that the
preference can be overridden.
* Get the diff type from the initial state of the no-JS button. Infuse
the widget to access the active property using the OOUI public API.
* For a logged-in user, when the JS toggle is clicked, fetch the new
diff body and update the user preference.
* For an anonymous user, when the JS toggle is clicked, update the
prev/next links to include the correct diff-type query parameter.
Bug: T336713
Change-Id: Ie409d79ac8222dfa6ec8fd170b76be088be80b3a
Since it’s needed by EntitySchema, and because it was also, as far as I
can tell, removed without following the stable interface policy in
change I5c506e3916 (commit 2aa87cdf2c).
Not marked as soft-deprecated because there doesn’t seem to be a way to
access the replacement.
Bug: T342209
Change-Id: Iba9fd8bb56ea0e1543c9a9beab85b01f9549fbd7
* 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
StubUserLang was meant to avoid the cost of looking up the user
preferences on requests which don't need it. There's no point in using
it if you are going to unconditionally call a method on the resulting
object.
StubUserLang proxies to RequestContext::getLanguage() via __call(),
which has a cost. Originally this cost was avoided on subsequent calls
by overwriting $wgLang, but this mechanism is not effective if you retain
a reference to the StubUserLang.
Removing the potential for Title::getPageLanguage() to return
StubUserLang simplifies the type declarations for methods that call it.
Bug: T160814
Change-Id: I12ad75c2496ca727580aac55e860178d15febb6e