aboutsummaryrefslogtreecommitdiffstats
path: root/includes/actions/ActionEntryPoint.php
Commit message (Collapse)AuthorAgeFilesLines
* Namespace all remaining files in includes/exceptionJames D. Forrester2025-03-251-5/+5
| | | | | | | | | In MediaWiki/Exception, to follow PSR-4 per plural vs. singular (this can be changed later if people really care). Also, move the couple of exceptions in here that were already namespaced in the MW-top-level into the new space. Bug: T353458 Change-Id: I12ed850ae99effb699a6d7ada173f54e72f0570e
* Namespace all remaining files in includes/actionsJames D. Forrester2025-03-191-2/+0
| | | | | Bug: T353458 Change-Id: Id3ca24e22877e544b707a8a527a58e00cc1bc247
* Namespace all remaining files in includes/pageJames D. Forrester2025-03-181-2/+2
| | | | | Bug: T353458 Change-Id: I7a9c74f2106655d41ae029742090253f541bd4a6
* Avoid constructing Title from LinkTarget where not neededthiemowmde2025-01-241-3/+1
| | | | | | | | | | | | | | I just find this combination of method calls confusing. A revision can not be addressed via a LinkTarget. We can only end having a revision when we started with a proper PageIdentity. This is actually hard-coded in the RevisionRecord constructor. So why not use that PageIdentity when we have the guarantee that it's available? I believe the proposed replacement is also faster. Not only because we avoid calling some extra code. The new code makes sure that the page ID is never lost and doesn't need to be queried again. Change-Id: I3ea3dd8b52566cc9883f3328c7748584fb3d05ff
* Remove 2-line PHPDocs that just repeat the types from the codethiemowmde2025-01-171-1/+0
| | | | | | | | | | | | | | | | Same as Ia294bf4 did for 1-line comments. This patch removes slightly more complex 2-line PHPDoc comments that don't add any new information to the code, but literally repeat what the code already says. They say "don't document the code, code the documentation", and we are doing this more and more. We just tend to forget to remove the obsolete comments. Note I'm also removing a line of text in a few cases when it's very short and literally says the same as the method name. Again, such comments add zero new information. Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
* Don't copy POST query params when generating link/redirect URLsBartosz Dziewoński2024-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | Use WebRequest::getQueryValues() instead of WebRequest::getValues() whenever the result is used to generate links or redirect URLs, so that only GET query params are copied and not POST params. This is the same change as I53e58c16cd1292d78b5775358fc180901f4ce203 (for T309907), but repeated in several more places. Two of these had bugs filed for it (T152920, T291852), others were as yet undiscovered. Some of my changes have no effect in practice (e.g. when the code is guarded by wasPosted()), but I'm changing them anyway to avoid perpetuating the bad pattern. Bug: T152920 Bug: T291852 Change-Id: I67fbf82a7ec084623595e6aff62c26dbcce8fa4d
* Merge "WebRequest: Deprecate parameter $default in getRawVal"jenkins-bot2024-10-101-3/+3
|\
| * WebRequest: Deprecate parameter $default in getRawValFomafix2024-10-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | build: Use inline ignore for MediaWiki.Usage.DeprecatedGlobalVariablesUmherirrender2024-09-261-0/+2
|/ | | | | | | | 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
* rdbms: Migrate MediaWiki.rdbms_trxprofiler_warnings to statslibLarissa Gaulia2024-09-071-1/+1
| | | | | | | | | | * Remove StatsdAwareInterface * Remove setStatsdDataFactory() * Add setStatsFactory() * Migrate api and action setStatsdDataFactory() usage. Bug: T359366 Change-Id: Ic4e82c24d3b1cdca638b22885902cc441d8510b8
* Allow interwiki redirects on the same domainMáté Szabó2024-04-251-3/+1
| | | | | | | | | | | | | | | | | | | | Currently, the logic handling local interwiki redirects (e.g. https://example.com/wiki/iwprefix:Foo) treats the title as invalid if the target is under the same domain as the origin, ostensibly to prevent redirect loops. This seems to be a somewhat arbitrary limitation that has been present ever since the feature was added in 52def2f. This limitation causes headaches for sites that host sister projects under the same domain, e.g. https://starwars.fandom.com/wiki/essences:Test works fine but https://starwars.fandom.com/wiki/es:Test requires a bag of tricks involving hijacking the BadTitleError thrown from the init code at the output stage and serving up a redirect anyways. Instead, allow interwiki redirects under the same domain and prevent trivial redirect loops by checking that the target URL does not equal the request URL. Bug: T363423 Change-Id: Idcac16979e668903b9dd2bacdc4c6d14d5843a1c
* Add explicit parentheses around mixed boolean operatorUmherirrender2024-03-231-2/+2
| | | | | | | Mixing different binary boolean operators within an expression without using parentheses to clarify precedence is not allowed (T358966) Change-Id: I24ca752d5dac7c948fdbcabf721f6f0aef8a466f
* Namespace includes/contextJames D. Forrester2024-02-081-1/+1
| | | | | Bug: T353458 Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
* Merge "entrypoint: Isolate entry points from PHP runtime for testing"jenkins-bot2024-02-021-10/+2
|\
| * entrypoint: Isolate entry points from PHP runtime for testingdaniel2024-02-021-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | 1) Introduce EntryPointEnvironment which wraps functions that interact with the PHP runtime, so they can be mocked for testing. 2) Allow server info fields to be overwritten in FauxRequest. 3) Make MediaWikiEntryPoint use WebResponse to set headers Bug: T354216 Change-Id: Ic21950c956de5d2b5a7dd66a1e2de58f807cfd9f
* | index.php: Restore support for forcesafemode option.daniel2024-01-301-0/+6
|/ | | | | | | | This code was originally introduced in I6f2d024c01cdb1 and then accidentally removed in a rebase of Ib70e4e67e4cb. Bug: T355314 Change-Id: Ibc4431b15d5ddbdff69ac62e287d5e8e5f6beec0
* MediaWikiEntryPoint: Inject MediaWiki services containerDerick Alangi2024-01-241-4/+6
| | | | | | | | | | | In order for sub-classes to benefit from this abstract class, inject the services container to lazily get all service dependencies needed within calling code. Define protected getters that can be overriden or called directly to get the service needed. Change-Id: I23a60907805dfb8fb7ce8160df63ababefcd62c3
* entrypoint: Restore doc grouping for MediaWikiEntryPointTimo Tijhof2024-01-051-4/+4
| | | | | | | | | | | | | | | Follows-up Ib70e4e67e4cb1. * This removed index.php from the "entrypoint" group, but did not add MediaWikiEntryPoint in its stead. * Fix broken `@see` reference, leading slash is not part of the identifier for the `@file` block index.php, only works without it. * Move the defgroup to a more natural place in the parent class' file. Bug: T354216 Change-Id: I1281e0934368884f4d1ffbbd3f5588b9a211356f
* Introduce MediaWikiEntryPoint and ActionEntryPointdaniel2024-01-031-0/+750
This extracts the MediaWikiEntryPoint base class and ActionEntryPoint class from the MediaWiki class. MediaWiki itself be deprecated. The intent is to create other subclasses of MediaWikiEntryPoint for the use by other entry points such as thumb.php or api.php. This will allow us to share code between entry points, and make these entry points testable by moving their implementation into a class. Bug: T354216 Change-Id: Ib70e4e67e4cb1b65ac218c095864fb6eb43d0929