aboutsummaryrefslogtreecommitdiffstats
path: root/includes/diff
Commit message (Collapse)AuthorAgeFilesLines
* Hard deprecate OutputPage::setRevisionTimestamp()C. Scott Ananian2025-04-041-1/+1
| | | | | | | | | | | | | This method was already deprecated, and mentioned in the RELEASE-NOTES. This patch just removes use of the method in core; it does not seem to be used outside core: https://codesearch.wmcloud.org/deployed/?q=-%3EsetRevisionTimestamp%5C%28 Bug: T301020 Follows-Up: Iee09b1591bfa11142686c9043a8294e7e77d2b61 Change-Id: I7528b9bc3522ed05f41f0915e38940b4a1fd48ce
* Replace a number of uses of class aliases with the real thingsJames D. Forrester2025-03-261-0/+3
| | | | | | | Found via disabling phan's alias support for a run (and ignoring wgLang's hard-coded state of being a \Language, alas). Change-Id: I4753bcd84d72d6de111fc7ffc5841fa417bf7333
* Namespace all remaining files in includes/exceptionJames D. Forrester2025-03-253-0/+3
| | | | | | | | | 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
* Merge "[OutputPage] replace ParserOutput::getText() options with ↵jenkins-bot2025-03-241-1/+1
|\ | | | | | | ParserOptions, v2"
| * [OutputPage] replace ParserOutput::getText() options with ParserOptions, v2C. Scott Ananian2025-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppress TOC, section edit links, and set wrapper div class via ParserOptions, instead of by passing options to ParserOutput::getText(). In the process deprecate the public OutputPage::parserOptions(), which is no longer used internally, and add OutputPage::addTOCPlaceholder() to DRY out some oft-repeated code. Bug: T350626 Depends-On: I6c12db1e0c42fe5b50ef43a9b6ff6804f44081ea Depends-On: I0d557951b8e17de05e8ceadeb6c18d3811bbdaa8 Change-Id: Iec19f9f08a4d88ea534ffa7b24e6e01ffbba2723
* | DifferenceEngine: Replace use of deprecated PermissionStatus methodsBartosz Dziewoński2025-03-231-4/+17
|/ | | | Change-Id: I377e30f91ae41730b14731133c763fa100fb616f
* Namespace all remaining files in includes/recentchangesJames D. Forrester2025-03-201-1/+1
| | | | | Bug: T353458 Change-Id: I2ae4577de79832b082adca282ff73cfabc8f9392
* Namespace all remaining files in includes/pageJames D. Forrester2025-03-181-1/+1
| | | | | Bug: T353458 Change-Id: I7a9c74f2106655d41ae029742090253f541bd4a6
* Avoid constructing Title from LinkTarget where not neededthiemowmde2025-01-241-6/+4
| | | | | | | | | | | | | | 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-4/+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
* Remove trivial 1-line PHPDocs that just repeat the codethiemowmde2025-01-164-16/+0
| | | | | | | | | | | | | I assume these are all either auto-generated by an IDE or the language-level type declarations have been added later. In any case the comments don't add any new information to what the code already says. This is just extra clutter that makes the code harder to read, I would argue. There are many, many more comments like this. In this patch I intentionally focus on the most trivial 1-line comments. Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
* Modernize status and error message handlingBartosz Dziewoński2024-11-281-7/+5
| | | | | | | | | | | | | | * Use pretty error boxes instead of 'error' CSS class. * Use Status::getMessages() and display each error individually, instead of getWikiText(). The latter sometimes messes up the display of complex messages, such as customized AbuseFilter errors. * Add missing 'mediawiki.codex.messagebox.styles' (some of these pages already used pretty error boxes in other code paths). * Other minor fixes. Bug: T377384 Bug: T375287 Change-Id: If2299f98f23e9ad057bce56260e264507337e0b6
* diff: Load codex messagebox styles for Html::warningBox usageUmherirrender2024-11-271-0/+8
| | | | | Bug: T380945 Change-Id: I6b87ae7ae964982998e616ed31a58c5f1decc3b7
* 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
* Use namespaced classesUmherirrender2024-10-216-0/+9
| | | | | | | Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
* Deprecate OutputPage::{get,set}PreventClickjacking()C. Scott Ananian2024-10-171-4/+5
| | | | | | | This is redundant with the same-named methods on ParserOutput. Bug: T301020 Change-Id: I60455186e3a6e9b4329ff09e2f7ea920e2e05192
* Use explicit nullable type on parameter argumentsUmherirrender2024-10-164-5/+5
| | | | | | | | | | | 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
* Add namespace to remaining parts of Wikimedia\Mime and Wikimedia\StatsJames D. Forrester2024-09-271-0/+1
| | | | | Bug: T353458 Change-Id: If0137003ab625017d322d57870448a02569668c3
* Add missing documentation to class properties (frontend-related)Umherirrender2024-09-051-0/+1
| | | | | | | | | | 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
* Move Language and friends into Language namespaceJames D. Forrester2024-08-102-2/+2
| | | | | Bug: T353458 Change-Id: Id3202c0c4f4a2043bf97b7caee081acab684155c
* Drop writeapi userrightReedy2024-07-311-3/+1
| | | | | | Bug: T294397 Depends-On: Ib34228a18917e404517d45e539bd786419d9c401 Change-Id: Ifad2edc782b36d21c8c67fecde7f011dce02c11b
* diff: migrate TextSlotDiffRenderer to use StatsFactoryCole White2024-06-281-5/+19
| | | | | Bug: T359241 Change-Id: I4f443b004b9ed77b9e6b8b1144d0cc2847a55d16
* Merge "Use namespaced classes (1)"jenkins-bot2024-06-182-0/+2
|\
| * Use namespaced classes (1)Umherirrender2024-06-162-0/+2
| | | | | | | | | | | | | | Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: Ic4d4dd61de5ab896fb6173eb579c81f164a1e4a3
* | diff: Mark TextSlotDiffRenderer DI setters as `@internal`Timo Tijhof2024-06-151-0/+2
|/ | | | | | For use by I4f443b004b9ed7 (T359241). Change-Id: If6acfb4fbb041dc13c7b4ccfaae4abd6f5b9b550
* Merge "Add namespace and deprecation alias to TextContent"jenkins-bot2024-05-201-0/+1
|\
| * Add namespace and deprecation alias to TextContentEbrahim Byagowi2024-05-191-0/+1
| | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Content to TextContent and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: Ic251b1ddfcf6db9c85cb54cddf912aa827d2bc3a
* | Import InvalidArgumentException at top of the sourceEbrahim Byagowi2024-05-192-3/+5
|/ | | | | | | | | | | | | | It was asked in a patch review to apply fully import InvalidArgumentException where possible. I was guessing some of my other already merged patches have but turned out such thing exists other places style so for the sake of consistency I've turned rest of inline import of the specific exception at top of the file. There are instances of source files that aren't in any namespace but have fully qualified import which this patch doesn't touch. Change-Id: I4071fc698b65746d9594cf4d5f45bae82843d436
* Merge "Metrics: Migrate MediaWiki.diff_cache.* to statslib"jenkins-bot2024-05-101-4/+12
|\
| * Metrics: Migrate MediaWiki.diff_cache.* to statslibLarissa Gaulia2024-05-041-4/+12
| | | | | | | | | | Bug: T359240 Change-Id: Iec49ddac0f7b24ad45b7a25e5832c91f5ee55214
* | Add namespace and deprecation alias to DeprecationHelperHakan Özdemir2024-05-051-0/+1
|/ | | | | | | | | 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
* Always show patrol link regardless of whether in diff-only modeJon Robson2024-02-221-8/+3
| | | | | Bug: T357693 Change-Id: I93736bd8ca4cc69cb89023d83872dcc3d71694a5
* diff: Change order of inline diff legend elementsSam Wilson2024-02-151-1/+1
| | | | | | | | To match the order that's used within the diff (deleted followed by inserted). Bug: T357150 Change-Id: I80dd954e8bfb699280dcf5791cc16e153b291e17
* Diffs: Always render patrol link in HTML and hide via CSSJon Robson2024-02-121-9/+15
| | | | | | | | | | | | 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
* build: Upgrade mediawiki/mediawiki-phan-config from 0.13.0 to 0.14.0 manuallyJames D. Forrester2024-02-101-3/+3
| | | | | | | | | | | * 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
* Namespace includes/contextJames D. Forrester2024-02-084-1/+6
| | | | | Bug: T353458 Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
* Change more uses of getDBLoadBalancerFactory() to getConnectionProvider()Bartosz Dziewoński2024-01-231-1/+1
| | | | | | | | | | | 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 8604c384f624273f46b653ec252ffaed30e6ff89. Change-Id: I6657d783375fac5c7fa856b884ff1fb09285e94c
* PoolCounter: Namespace classesAmir Sarabadani2023-12-201-0/+1
| | | | | | | | Two of the classes in this directory have already namespaced to MediaWiki\PoolCounter. Bug: T353458 Change-Id: Ie41f8d935f7623bb40040a5eb78f99c6d7b7b75e
* Namespace ParserOutputJames D. Forrester2023-12-141-1/+1
| | | | | | | Most used non-namespaced class! Bug: T353458 Change-Id: I4c2cbb0a808b3881a4d6ca489eee5d8c8ebf26cf
* Use namespaced classesUmherirrender2023-12-111-0/+1
| | | | | | | Changes to the use statements done automatically via script Addition of missing use statements and changes to docs done manually Change-Id: I443aada1c18c8628b02671aa9fd6f441961e5c2e
* Move user options related classes into its own namespaceMartin Urbanec2023-11-291-1/+1
| | | | | | | | | | | | | 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
* diff: Fix LinkRenderer method callAmmarpad2023-10-251-0/+1
| | | | | | Bug: T349726 Follow-up: Ie8ac1aab6d2fe5f4575a6891c36efe497458e093 Change-Id: Ibd728d171ce7e821f9a67131ad466d779681fe49
* Diffs: Use JS friendly data timestamp instead of mediawiki timestampJon Robson2023-10-231-3/+8
| | | | | | | | | | | 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
* Merge "DifferenceEngine: Wrap edit, undo thank link tools with CSS parentheses"jenkins-bot2023-10-171-3/+2
|\
| * DifferenceEngine: Wrap edit, undo thank link tools with CSS parenthesesJon Robson2023-10-171-3/+2
| | | | | | | | | | | | | | This allows other skins to skin these differently. Bug: T240624 Change-Id: I3232c2f5075ae6ef2ba5a1bdcd63530461919b6f
* | Merge "DifferenceEngine: Add user meta information on diff pages"jenkins-bot2023-10-171-2/+73
|\ \
| * | DifferenceEngine: Add user meta information on diff pagesJon Robson2023-10-171-2/+73
| |/ | | | | | | | | | | | | | | | | 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
* / TextSlotDiffRenderer: show tooltip instead of help icon on inline switchMusikAnimal2023-10-171-2/+3
|/ | | | | | | Also add to the switch itself, not just the label Bug: T346429 Change-Id: Ia7319a63878e029765c08a44f890fe96205c35da
* Remove meaningless /** #@- */ commentsthiemowmde2023-10-151-2/+0
| | | | | | | | | | | 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
* diff: add help message to inline switchhmonroy2023-10-131-1/+2
| | | | | | | | | | Add help message that explains what the inline toggle does when you click it. Remove 'diff-table-format-label` text since it is not being used. Bug: T346429 Change-Id: Idc3aefffd03d491a573b27c7e18b337f68bbc9cf