Add SpecialWhatLinksHereQueryHook hook that allow extensions
to modify the query builder to add more conditions based on
the filters added in the SpecialPageBeforeFormDisplay hook.
Bug: T216368
Change-Id: I221d4e0ad671feab6937719d4a2f894ad6154bb1
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
Why:
To facilitate the evaluation of conditions not directly
"known" by the lookup, eg: owned by extensions
What:
- Add ConditionalDefaultOptionsAddCondition hook which
runs before instantiating ConditionalDefaultsLookup allowing
to add conditions for evaluation in the $extraConditions
array.
- Evaluate the configured conditional default against the
extra added conditions after evaluation of "known"
conditions.
Bug: T376918
Change-Id: Ife6f96397eafd61fdb40528aac315ddde1ef2774
Replaces 'copyright' with 'copyright-footer' and 'history_copyright'
with 'copyright-footer-history' (the original still takes precedence
if set). Adds SkinCopyrightFooterMessage hook which works the same
way as SkinCopyrightFooter for the new messages. Allows disabling
the old messages by setting $wgAllowRawHtmlCopyrightMessages = false.
Co-Authored-By: Gergő Tisza <tgr.huwiki@gmail.com>
Bug: T45646
Change-Id: I5fd5607f8d43b6e934c8d4d35097cec430c56043
Why:
* A hook is needed which is called when User::spreadAnyEditBlock
is called, so that extensions which provide alternative blocking
mechanisims (such as the GlobalBlocking extension) can spread
their blocks when local blocks are spread.
What:
* Add SpreadAnyEditBlockHook which is called from User
::spreadAnyEditBlock when it is called except when the user is
not registered.
** The hook is called even if the user is not locally blocked
* The return value of User::spreadAnyEditBlock is modified to
return true if either a local block or alternative blocking
mechanism spread blocks.
* Update UserTest to test this new behaviour.
Bug: T374857
Change-Id: Id302a6362d6177c89da9cdf4e677b3822ecb85f1
This allows to change the category link rendering by extension
CategoryTree without missing update of mCategoryData and mCategories
which leads to wgCategories = [] (T372155).
The new hook will be used in extension CategoryTree by
Ic86f210474cbc0e2dcebf664cf2309a4a4408f60.
Bug: T372155
Change-Id: Id82a77a57d1f12233d974ea4c1b093f50c5ab74f
Add a new hook that can be used to prevent authentication just
before AuthManager takes the main action (writing the session
for login, creating the local user account for account creation).
The driving use case is a wiki which supports both a local and
a central (wiki-farm-level) login or signup flow - various
security options (such as 2FA) are needed during local login
but unnecessary during central login (which will have those
security features centrally), so we need to skip much of the
security when the user is taking the central route, and a bug
in how that's done could result in circumvention of security
features during local login. The hook makes it easy to inspect
and potentially interrupt login near the end, when we know for
sure what route it took. (Specifically, we know which primary
provider was used. The hook doesn't expose other details,
such as the list of preauth or secondary provders that were
invoked, because they were not needed for the immediate use
case, but they are easy to add in the future.)
The hook is called after the secondary providers for login
and before them for account creation, since secondaries can
interrupt login but cannot interrupt account creation.
A shortcoming is that since the hook is called after a primary
provider succeeded, it cannot prevent the primary provider from
doing work, ie. it cannot prevent creation of the remote account
during account creation (although it will prevent the creation
of the local account). This is not great but acceptable, since
creating a new account isn't very security-sensitive.
This also means the hook would not be useful during account
linking, as AuthManager does not do anything there, all the work
happens in the primary provider. This is even less great but
few authentication extensions implement account linking.
The hook is not called for authentication happening via
CreatedAccountAuthenticationRequest, which is a weird internal
hack hook handlers should not have to know about.
Also rename a confusingly named variable.
Change-Id: I835b2fe2f43e6e81f23348165cbb9c93832e6583
Allow disabling authentication providers. This allows for
extensions to replace core providers with their own.
This is using the $wgAuthManagerAutoConfig keys instead of
AuthenticationProvider::getUniqueId() as the keys to filter.
This makes it more useful for site administrators, and also
it's probably the better known of the two identifiers so
more intuitive.
No effort is made to prevent the hook from filtering
differently in different steps of the same authentication
process.
Bug: T369180
Change-Id: If5435b54a4fc08f685c04fc10eb44c6d72cd78fa
This hook enables extensions such as CentralAuth to preserve and
use query parameters needed for an authentication flow. Since there
is a provider that handles logins in a different wiki (central login
wiki), and movement to a different URL, this hook preserves query
parameters that can be used between these requests.
Bug: T363483
Bug: T362713
Change-Id: I86e629b07e6e4a0f1d1a4c78a6c77d41b4d68e18
This patch introduces a namespace declaration for the
MediaWiki\Content to JsonContent and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I44abb1ab5bd1fabf9886dc1457e241d7cae068bc
Add SpecialPrefixIndexGetFormFiltersHook hook that allow extensions
to add custom filters on Special:PrefixIndex and another hook
SpecialPrefixIndexQuery that allows you to modify the query builder
to add more conditions based on the filters selected.
Bug: T299308
Change-Id: Iabc672086547d0b19f01cc95892633c2668821ef
The hook is no longer called, so the deprecation warning of the
HookContainer (as mention in DeprecatedHooks) cannot work as expected.
Change-Id: Idb586e9c2d8ba87411acc137537db6d6c75485a7
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
- 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
Add a legend at the top of the inline diff display, showing the
meanings of the colours of the inserted and deleted highlighting.
Also add the same text as tooltips on the highlighted elements.
The legend is added as part of a new area above the diff table
that can be modified via a new TextSlotDiffRendererTablePrefix
hook, so that extensions can add other buttons etc. there as
required.
This is a follow-up to the previous attempt, which added the
legend in DifferenceEngine::showDiff() and was called from
too many places. This patch moves it to be called in
DifferenceEngine::showDiffPage().
Bug: T324759
Change-Id: I2a3c67bcfa47313dee597e602a62073e4e298cd2
Follow-up: I6de30bf79eb5ac262285951792782b870d075e00
Add a legend at the top of the inline diff display, showing the
meanings of the colours of the inserted and deleted highlighting.
Also add the same text as tooltips on the highlighted elements.
The legend is added as part of a new area above the diff table
that can be modified via a new DifferenceEngineBeforeDiffTable
hook, so that extensions can add other buttons etc. there as
required.
Bug: T324759
Change-Id: I6de30bf79eb5ac262285951792782b870d075e00
Common naming convention for hook runner interfaces
The hook is new in 1.40 and the rename should be backported,
but the old name needs alias as it is already used in extensions.
Bug: T334689
Change-Id: I3f9e6d33f1bf29e937c82860fcebd088dde647da
This new hook is called only once, for all overrides, instead of
every time a message is fetched.
Overrides can be specified as string or a callable, to allow for
dynamically computing the override on-demand. These callables are
passed the message key, MessageCache instance, the language and a
boolean indicating if the message should be fetched from the
database.
The parameter choices are based upon current usages of the
MessageCache::get hook.
Bug: T328183
Change-Id: I89e1a9b901aff6ff1bde729df8958ba42a45f3d5
This adds a hook similar to the PageDeleteCompleteHook, passing a similar level of detail through to extensions about a page's undeletion.
This further deprecates the ArticleUndelete hook as this new hook replaces its functionality.
Bug: T321412
Change-Id: Id77d945dfe14f196c34652b4f3d2f3ec843cbe7c
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
The hook was deprecated in 1.35.
Further, the hook was only introduced to power the SpecialMuteSubmit
instrument for the User Mute Features Community Health Initiative
project [0].
[0] https://meta.wikimedia.org/wiki/Community_health_initiative/User_Mute_features
Bug: T329718
Depends-On: I2b014dbae0df278f3e051955c1b086a8c7b78fdf
Change-Id: I0c100eb6f3008003ce9678c3dd8346862ae8a914
None are used in WMF-deployed extensions and have been hard deprecated
for multiple releases as well.
Change-Id: I62cfa22291f81295b4908192de8657a750c6716d
Part one, none of these hooks are used in extensions deployed in
production. I skipped any hook that has silenced its deprecation
warnings.
Change-Id: Idf1fd12cc61ca30867dc9f8aeb1701fe035fc5ff
Changed the PreferencesGetLayoutHook parameters so that it no longer passes a Skin variable. Now, the hook will pass an additional string variable with the skin name and an associative array with extra skin properties the hook might need.
Bug: T322781
Change-Id: I0c4e76b528d0196ae6929fd8ed71abc6c860dfc4
Depends-On: I200aec586dbe8613e9a9c762db8d9bcbdc69a35b
Added an optional RevisionRecord param to:
- ContentHandler::getParserOutputForIndexing
- ContentHandler::getDataForSearchIndex
- the SearchDataForIndex hook
So that they have a chance to build the content related to a specific
revision.
Ultimately we'd like to make this parameter mandatory.
Bug: T317309
Depends-On: I8b220cd6c4aeeca1d924bdd527409b8602318944
Depends-On: I8616b611caab3f5fa97ff0e655b19c3034304597
Change-Id: I3298ce7591069eb32f624b2c9fbb6de58ae04a29
Added icons to Special:Preferences' mobile layout sections. Also added a hook so extensions can add their own icons.
Bug: T317419
Change-Id: I6d5730d47e7595b1705787995fe5db2fe734d7f5
- Added a hook that checks if the preferences should have a mobile or desktop layout
- Added descriptions to preference tabs, which now display as a stack layout in mobile
- Added a new mobile JS file to control Special:Preferences when in mobile view
- Built the mobile interface in the preferences form
Bug: T311717
Change-Id: I468481b66bf96880d1779cd11a46e18745e2c894
Follow up to I7f064a954a77373dfec86efae7e378402f500198
From: I28aa164119bc0dbc00f5fcf20bc53dc4851ca0b5
* Fix typo in contribute.css
* Removes selector specificity (scoped to body class to prevent
these styles loading on other special pages)
* Removes non-existent mediawiki.special.contribute module
* Fixes font-sizes to match specification (existing values were invalid).
From: Icfd8a7965d83f2429637139ca0de9ed1520b4169
This module contains all the possible icons this page could make use
of. Seems better to load this one than create an additional ResourceLoader
module to fragment things further.
Changes:
* Use Context for messages instead of wfMessage
* Use generated URLs rather than static ones for the default card
* ContributeCardsHook::onContributeCards is void ( no prevention mode )
* SpecialContribute fixed typo
* Fixed capitalization in messages jsons
* Load Classes with PSR-4
* Redirected always to user's page of the Special:Contribute page ( fixes default selection of tab)
Bug: T286466
includes: I28aa164119bc0dbc00f5fcf20bc53dc4851ca0b5
includes: Icfd8a7965d83f2429637139ca0de9ed1520b4169
Change-Id: Iac34777a89e3e6732a0916dbf0a22677cbc6d121