aboutsummaryrefslogtreecommitdiffstats
path: root/includes/HookContainer/HookRunner.php
Commit message (Collapse)AuthorAgeFilesLines
* Namespace all remaining files in includes/skinJames D. Forrester2025-03-251-1/+1
| | | | | Bug: T353458 Change-Id: I3e829e35c93bcaae75e401b1801bddf93c0b416c
* Namespace all remaining files in includes/loggingJames D. Forrester2025-03-191-1/+1
| | | | | Bug: T353458 Change-Id: Ibe1810f1c71316a9124e1dc6ae405097dafd5267
* Namespace all remaining files in includes/filerepoJames D. Forrester2025-03-191-1/+1
| | | | | Bug: T353458 Change-Id: I35864ad9bd48701703c51367d62f8ebde963c52d
* Namespace all remaining files in includes/pageJames D. Forrester2025-03-181-2/+2
| | | | | Bug: T353458 Change-Id: I7a9c74f2106655d41ae029742090253f541bd4a6
* Add 'PermissionStatusAudit' hook to replace 'PermissionErrorAudit'Bartosz Dziewoński2025-02-071-0/+16
| | | | | | | | | The previous hook relies on the deprecated method PermissionStatus::toLegacyErrorArray() to function. Introduce a new hook which is the same, except it passes the status object directly instead of the legacy array. Change-Id: If0aa2ca37a8408d7496dd4ba4c95ed2423438eec
* Add ChangesListInsertLogEntry hookDreamy Jazz2025-01-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * A hook is needed by the CheckUser extension that allows it to add a CSS class to any log line displayed in Special:RecentChanges or other HTML RC feed, where the class is added only if specific conditions about the log are met (e.g. performer is a temporary account). * No other hook exists which is both specific to log entries in RC feeds and also allows modifying the CSS classes that wrap the specific log entry (as opposed to a group of log entries). * Therefore, a new hook is needed that allows this modification. What: * Call the new ChangesListInsertLogEntry hook in ChangesList ::insertLogEntry which is used to generate the HTML for a log entry in an RC feed. * Add the ChangesListInsertLogEntryHook interface, and implement it in HookRunner.php * Add tests for ChangesListTest to cover the code that was previously untested and also modified in this commit. This also checks that the hook works as expected. Bug: T370083 Change-Id: I7d907823d9f15d518c55494f28950441a98f6f86
* Remove deprecated hook OutputPageMakeCategoryLinksFomafix2024-12-181-8/+0
| | | | | | | The hook is deprecated since I8ea56f2d111aeccee158c40b8379383e92154d8a included in MediaWiki 1.43. Change-Id: Icdf724fa2eeab10d4895fa1d45d7ff7320626c4e
* Add AuthenticationAttemptThrottled hookDreamy Jazz2024-10-231-0/+7
| | | | | | | | | | | | | | | | | | | Why: * A hook is needed to allow extensions to run code when an authentication throttle causes throttling. ** This is so that we (T&S product) can monitor how many users are hitting the rate limits for temporary account creation on WMF wikis. What: * Add the AuthenticationAttemptThrottled hook, which is called from Throttle::increase when the method returns that the action should be throttled. * Update the tests for the class to verify the hook is called when it should be. Bug: T375500 Change-Id: I614ff6178d4a4f02b5c76d4b8818cb917c4d75aa
* WhatLinksHere: Allow extensible filtersHuei Tan2024-10-211-0/+9
| | | | | | | | | 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
* Use explicit nullable type on parameter argumentsUmherirrender2024-10-161-1/+1
| | | | | | | | | | | 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
* ConditionalDefaultsLookup: allow to dynamically add conditions for evaluationSergio Gimeno2024-10-161-1/+10
| | | | | | | | | | | | | | | | | | 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
* Namespace all remaining classes in includes/parserJames D. Forrester2024-10-151-1/+1
| | | | | Bug: T353458 Change-Id: If02cc9b1ff78e26c1cf8c91ee4695845eb133829
* Switch over a bunch of class_alias uses to actualsJames D. Forrester2024-10-031-2/+5
| | | | Change-Id: Id175a83e71cc910eaee5d5890a9106872a3ca3b8
* Replace raw HTML copyright footer message with wikitext oneBartosz Dziewoński2024-09-261-0/+8
| | | | | | | | | | | | 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
* Add SpreadAnyEditBlock hookDreamy Jazz2024-09-241-0/+8
| | | | | | | | | | | | | | | | | | | | | 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
* Add new hook OutputPageRenderCategoryLinkFomafix2024-09-051-0/+15
| | | | | | | | | | | | 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
* auth: Add AuthManagerVerifyAuthentication hookGergő Tisza2024-08-261-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* auth: Add AuthManagerFilterProviders hookGergő Tisza2024-08-261-0/+9
| | | | | | | | | | | | | | | | | | 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
* Introduce hook to preserve query params after authenticationDerick Alangi2024-07-081-0/+7
| | | | | | | | | | | | 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
* Add namespace and deprecation alias to JsonContentEbrahim Byagowi2024-05-201-1/+1
| | | | | | | | | 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
* SpecialPrefixIndex: Allow extensible filtersReedy2024-02-181-0/+19
| | | | | | | | | | 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
* Move Parser to Mediawiki\Parser namespaceSubramanya Sastry2024-02-161-1/+1
| | | | | | | | Bug: T166010 Co-Authored-By: Daimona Eaytoy <daimona.wiki@gmail.com> Co-Authored-By: James Forrester <jforrester@wikimedia.org> Co-Authored-By: Subramanya Sastry <ssastry@wikimedia.org> Change-Id: I79b4e732c45095eedbaa80afa5eb7479b387ed8a
* Move hooks used by OutputPage into includes/Output/HookC. Scott Ananian2024-02-091-13/+13
| | | | | Bug: T166010 Change-Id: Ifdb9e6b59f126b47e4143c875c34a207643b7034
* Namespace includes/contextJames D. Forrester2024-02-081-1/+1
| | | | | Bug: T353458 Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
* Namespace ParserOutputJames D. Forrester2023-12-141-1/+2
| | | | | | | Most used non-namespaced class! Bug: T353458 Change-Id: I4c2cbb0a808b3881a4d6ca489eee5d8c8ebf26cf
* Remove deprecated interface ParserTestTablesHookUmherirrender2023-10-031-8/+0
| | | | | | | The hook is no longer called, so the deprecation warning of the HookContainer (as mention in DeprecatedHooks) cannot work as expected. Change-Id: Idb586e9c2d8ba87411acc137537db6d6c75485a7
* doc: Fix variable name in ContentHandlerForModelIDHookUmherirrender2023-09-301-2/+2
| | | | Change-Id: I62075b95d8b6108f1ad6cea26794ac39ac213c9a
* Drop the PersonalUrls hook, deprecated in 1.39James D. Forrester2023-09-211-9/+0
| | | | | Bug: T319087 Change-Id: I398de94099cf17d071bc539a87a140a76fd301bd
* Namespace remaining 'specialpage' files under \MediaWiki\SpecialPageJames D. Forrester2023-09-181-1/+1
| | | | | | | SpecialPageFactory is already here, but none of the others were yet. Bug: T166010 Change-Id: I9689bf0a1ab329625e23669b99f019b96295fffd
* Add UserGroupManager::getUserPrivilegedGroups()Gergő Tisza2023-09-021-0/+8
| | | | | | | | | 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
* content: Rename $output in ContentGetParserOutputHookUmherirrender2023-08-141-2/+2
| | | | | | This is a ParserOutput, $output is often used for OutputPage Change-Id: I98c62140db863243e0342b9747032dc425fccc83
* Remove deprecated SkinTemplateNavigation hooksAmmarpad2023-06-211-24/+0
| | | | | | | | - SkinTemplateNavigation hook - SkinTemplateNavigation::SpecialPage hook Bug: T339969 Change-Id: I0aa4a593ae5c795ca2f75234f379e5ad0efa48aa
* mail: Round 6 of EmailUser refactoringDaimona Eaytoy2023-06-201-0/+26
| | | | | | | | | | | | - 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
* diff: Add legend and tooltips to inline diff displaySam Wilson2023-05-311-0/+12
| | | | | | | | | | | | | | | | | | | | 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
* Revert "diff: Add legend and tooltips to inline diff display"Samtar2023-05-181-9/+0
| | | | | | | | | | This reverts commit 19eb61de664b9f3670bf240f76a6be53bd74abb3. Reason for revert: Reworking Change-Id: I2bc524254d10d6612c5b0a7db95dd6af5f60ccaa Depends-On: I5c3d7df530eb6fc09ba380d42a81b17511861308 Depends-On: I60784afa0d47e22acd9e8a981092784c84b250eb
* Move some hooks to ResourceLoader\HookRunnerUmherirrender2023-05-111-21/+0
| | | | | | | - ResourceLoaderGetConfigVarsHook - ResourceLoaderJqueryMsgModuleMagicWordsHook Change-Id: Ifd8fa776655b347cb539ac824426afb12463148a
* diff: Add legend and tooltips to inline diff displaySam Wilson2023-04-281-0/+9
| | | | | | | | | | | | | | 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
* Merge "Add Hook suffix to ParserModifyImageHTMLHook"jenkins-bot2023-04-171-1/+1
|\
| * Add Hook suffix to ParserModifyImageHTMLHookUmherirrender2023-04-161-1/+1
| | | | | | | | | | | | | | Common naming convention for hook runner interfaces Bug: T334689 Change-Id: I3043454a502289e5ee2492f7bf2ab01e155c30ba
* | Add Hook suffix to GetBlockErrorMessageKeyHookUmherirrender2023-04-161-1/+1
|/ | | | | | | | | | 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
* MessageCache: Add a new hook for more performant override fetchingmainframe982023-03-141-0/+9
| | | | | | | | | | | | | | | | 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
* Merge "Hooks: Remove deprecated SpecialMuteSubmit hook"jenkins-bot2023-03-061-8/+0
|\
| * Hooks: Remove deprecated SpecialMuteSubmit hookSam Smith2023-03-031-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Add PageUndeleteCompleteHook"jenkins-bot2023-03-061-0/+27
|\ \
| * | Add PageUndeleteCompleteHookOwen2023-03-041-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 coreTim Starling2023-03-031-0/+45
| |/ |/| | | | | | | | | | | | | | | 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
* | Reorg: Namespace the Title classJames D. Forrester2023-03-021-1/+1
|/ | | | | | | | | | | | | | | | | | | This is moderately messy. Process was principally: * xargs rg --files-with-matches '^use Title;' | grep 'php$' | \ xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1' * rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \ xargs rg --files-with-matches 'Title\b' | \ xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1' * composer fix Then manual fix-ups for a few files that don't have any use statements. Bug: T166010 Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
* Add SpecialCreateAccountsBenefits hookGergő Tisza2023-01-291-0/+8
| | | | | | | Add a new hook for modifying the hero message on the signup page. Bug: T325655 Change-Id: Ifea5cd0674f71e267a931a64a48c8ea5d052b334
* Drop more unused hard deprecated hooksAmir Sarabadani2022-12-011-26/+0
| | | | | | | None are used in WMF-deployed extensions and have been hard deprecated for multiple releases as well. Change-Id: I62cfa22291f81295b4908192de8657a750c6716d
* Drop unused deprecated hooksAmir Sarabadani2022-11-281-50/+0
| | | | | | | | 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