aboutsummaryrefslogtreecommitdiffstats
path: root/includes/changes
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix history pager toolsGergő Tisza2022-12-221-7/+13
| | | | | | | | | | | | | | | | | | | | | | Follows up Ia03038e86c6a607c8b75eefedbf0285ca1a2f8c8. * Only generate a rollback link for the latest revisions in ContribsPager. * Gate the entire ChangesList::insertPageTools beind the RC attribs check, not just the rollback link generation. * In ContribsPager::formatRow, check for the existence of $page in a more reasonable place. This was already broken before Ia03038e so I suspect $page is never null in practice (in theory, a ContribsPager__reallyDoQuery hook handler could somehow produce a $row with no title information), but it can't hurt. * Add some documentation and FIXMEs. * Remove a comment from ChangesList - part of it is not true anymore after Ia03038e, part of it already didn't make sense before that. Bug: T51541 Bug: T325753 Change-Id: If848e38b568492579382a2c920cb865fb0326d99
* Make use of ??= in more placesDannyS7122022-12-172-9/+5
| | | | | | New feature from PHP 7.4 Change-Id: Ifa7a9bc7b2ec415ad7ecb23f4c1776f51f58fd6b
* Merge "Make use of ?:, ?? and ??= operators in mostly trivial cases"jenkins-bot2022-12-162-7/+2
|\
| * Make use of ?:, ?? and ??= operators in mostly trivial casesthiemowmde2022-12-052-7/+2
| | | | | | | | | | | | | | | | | | | | The motivation is to make the code less confusing. I hope this is the case. ?? is an older PHP 7.0 feature. ??= was added in PHP 7.4, which we can finally use. Change-Id: Id807affa52bd1151a74c064623b41d950a389560
* | Generalize History pager tools for use in other contextsJon Robson2022-12-152-25/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The history page renders an extensible list of tools for each change list row. I've factored this code out so that it can also be used on other pages that use the Pager class. This generalizes the logic for the rollback link and makes sure the control is standardized across pages. It also allows the onHistoryTools hook run. I suggest we rename this to something more generic in a follow up. Right now usages of onHistoryTools are low but there should be no issues with running it on more than the history page. One of the benefits of this is the thanks link will now show on the contributions page, watchlist and recent changes. Bug: T51541 Change-Id: Ia03038e86c6a607c8b75eefedbf0285ca1a2f8c8
* | Clean up redundant array manipulationMatěj Suchánek2022-12-111-6/+1
| | | | | | | | | | | | PHP does this implicitly. Change-Id: I009a7c93d44fb5e8c430c971cfc637fa04a8e68d
* | Merge "Suppress RecentChange::doMarkPatrolled when autopatrol is requested"jenkins-bot2022-12-093-13/+14
|\ \
| * | Suppress RecentChange::doMarkPatrolled when autopatrol is requestedMatěj Suchánek2022-12-033-13/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | The result of the method has been inappropriate and surprising since rc_patrolled was changed to distinguish between manually patrolled and autopatrolled changes (T184791). When called with $auto = true, it would mark the change as manually patrolled (not autopatrolled), but it would not log it as such in patrol log and would still require 'autopatrol' right (not 'patrol'). Change-Id: I0bd6f2cf317d2b1c8dd50b7998724a57f5f549fb
* / Reorg: Move DummyLinker and Linker to linker/Amir Sarabadani2022-12-082-0/+3
|/ | | | | | | This feels like a no-brainer unless I'm missing something obvious Bug: T321882 Change-Id: Id49c3d0dd6ea4593211048850856b5b8e05a8fb3
* Use short array destructuring instead of list()Tim Starling2022-10-212-2/+2
| | | | | | | | Introduced in PHP 7.1. Because it's shorter and looks nice. I used regex replacement. Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
* Feed: Move feed-related classes to Feed/ and namespace themAmir Sarabadani2022-10-205-580/+5
| | | | | Bug: T166010 Change-Id: Icdbe003e74d2f31b68b575acfa94c09c24d7aed5
* Remove unused key variable from foreach loopsUmherirrender2022-09-211-1/+1
| | | | Change-Id: Id2d91e30a6f7cc4eb93427b50efc1c5c77f14b75
* Coalesce rc comment field to empty string if nullBrian Wolff2022-09-121-1/+1
| | | | | | | | | Follow up to I14c6c22d822ae4 Fixes a warning on php 8.1 where the comment on log entries might be null. Change-Id: If0e41f0696a24a56f112e05c46a9a7fdbfaa3aaa
* Setup: Remove internal short-cut config $wgUseEnotifUmherirrender2022-08-171-3/+4
| | | | | | | | | It is not possible to set $wgUseEnotif on LocalSettings.php, because it is always set on setup, it should not be a global/setting. Just remove it from the dynamic setup and use the config it is set from Bug: T305093 Change-Id: I9bfa502a0b9798bd149b4cfe4db86a0461e76f55
* Merge "Improve docs of various ::getQueryInfo functions"jenkins-bot2022-08-141-4/+5
|\
| * Improve docs of various ::getQueryInfo functionsUmherirrender2022-08-131-4/+5
| | | | | | | | | | | | Explict types helps phan to detect errors with keys like ef82d95 Change-Id: Iee4d964ecc58273eb9c73356ed34e13f29fbd275
* | Use native array_column() in ChangesListFilter codeThiemo Kreuz2022-08-082-24/+4
| | | | | | | | Change-Id: I9d0b95ebc8c37380b5a1f2ac2eb8e55b6707e1e6
* | Add revid to category changesSTran2022-07-271-0/+3
|/ | | | | | | | | Pass along a revid to category changes on Special:RecentChanges This change allows IPInfo downstream to pull the revid for use in its subsequent API call Bug: T310813 Change-Id: I533d5fffd64dc741d5b28563f9e0c0827a48906c
* recentchanges: Remove special handling of rc_ip for postgresUmherirrender2022-07-161-14/+0
| | | | | | The special type of the column was changed in 6809067 Change-Id: I308df77f3ab39ddddf6219e6c292ab50ec4bbc22
* RecentChange: Make join to comment table also straightAmir Sarabadani2022-06-301-0/+2
| | | | | | | The optimizer is refusing to pick the right join order Bug: T311360 Change-Id: I742201b45975a5edcac5d4634d70d50ee851f0ac
* RecentChange: Straight join to actor table when neededAmir Sarabadani2022-06-301-1/+1
| | | | | | | | It should avoid using straight join when there is a condition on the actor table which potentionally could make the query faster. Bug: T311360 Change-Id: Iad3d0cf2479c560be255f85d8896f37efae606c5
* Adding log links for deletion and protection to ChangesListdiesel kapasule2022-06-011-1/+5
| | | | | | | | Add action links for deletion and protection on Changeslist.php. This will make links more consistent with the log page entries. Bug: T49466 Change-Id: Ic1fdb2b4280bdeac521323aafe4548819778c870
* changes: Replace deprecated User::getOptionUmherirrender2022-04-291-1/+5
| | | | | Bug: T296083 Change-Id: I6744ed237fb30aec5540eb68140ab6f8c5d71246
* Use MainConfigNames instead of string literals, #2Aryeh Gregor2022-04-137-21/+38
| | | | | | | This covers all occurrences of /onfig->.*get( '/ in includes/. Undoubtedly there are still plenty more to go. Change-Id: I33196c4153437778496f40436bcde399638ac361
* Add mw-history-suppressed for userlink also on enhanced WatchlistUmherirrender2022-04-111-1/+5
| | | | | Follow-Up: I08f14f712479e1b170c606e2b64857f8386acd76 Change-Id: I63b6f484bf498a9bbe574eaac66f89b4e045c0e2
* Use MainConfigNames instead of string literalsAryeh Gregor2022-04-111-3/+4
| | | | | | | | Part 1, proof of concept. Hundreds of files left to go. These changes brought to you in large part by vim macros. Bug: T305805 Change-Id: I44789091e9f6394c800a11b29f22528c8dcacf71
* Merge "changes: Replace deprecated `User::newFromName()` to `::newSystemUser()`"jenkins-bot2022-04-021-3/+1
|\
| * changes: Replace deprecated `User::newFromName()` to `::newSystemUser()`Derick Alangi2022-03-211-3/+1
| | | | | | | | Change-Id: I65add7ed5e9aa95d1a626faaff05b94154ddf027
* | phan: Remove PhanTypePossiblyInvalidDimOffset suppressionUmherirrender2022-03-281-0/+1
|/ | | | | | | | | | | Make phan stricter about array keys Remaining false positive issues are suppressed. The suppression and the setting change can only be done together Bug: T304887 Depends-On: I3105a5fd4826f8667b5232834defc5ec93be32a1 Depends-On: Ie9610a6e83731468311edb3ed17f80fc509de385 Change-Id: I701f12ab94478c3b8e7fd82110ade74a8e6b04ef
* Fix various documentation related to scalar typesUmherirrender2022-03-091-1/+1
| | | | | | Found by phan strict checks Change-Id: If41d16b473baddd92cc4261cdc2bfbe65fedcb19
* rcfeed: Deprecate $wgRCEngines and RCFeedEngineTimo Tijhof2022-03-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | Follows-up 39a6e3dc4d (I8be497c623c5d92). * Improve documentation all around and advertise 'class' everywhere instead of 'uri'. * Add test coverage for RCFeed::factory(). * Deprecate the $wgRCEngines "uri to class" mapping in favour of specifying "class" directly in $wgRCFeeds. * Deprecate RCFeedEngine in favour of FormattedRCFeed. Convert to class_alias so that UDPRCFeedEngine no longer has to extend the deprecated class name explicitly (for instanceof compat). * Hard-deprecate RecentChange::getEngine. Bug: T250628 Depends-On: Ie939e1d06b9ee2d841ec7256c8d24cc4e7e386dd Change-Id: Ib6758d724c7200404c89c7ab157aa55f1cad9763
* Replace some more usages of Wikimedia\(suppress|restore)Warnings()Reedy2022-02-241-2/+3
| | | | Change-Id: I2eb133a9e32116cd155f59086245bc4d15ecbfcc
* Don't double-escape the ellipses in Language::truncateForVisual()C. Scott Ananian2022-02-103-3/+0
| | | | | | | | | | | | | | | | | | | | | | | It turns out this gets rid of a bunch of suppressed "SecurityCheck-DoubleEscaped" that appear to have been accurate warnings. There seems to have been some confusion about how ::truncateForVisual() is supposed to be used; in particular it is to be passed *unescaped* output, because it is not (generally speaking) safe to truncate HTML-escaped strings. The goal of ::truncateForVisual() is to have a specific number of codepoints in the output for display purposes, the encoding of those codepoints is not an issue (htmlspecialchars can be applied to the *return value*.) If you need a specific number of *bytes* you should be using ::truncateForDatabase(). If you want a certain number of *HTML bytes* then the ::truncateHtml() method is probably what you want. Slightly refactor some code in RevDelLogItem to avoid a false positive. Bug: T301205 Bug: T290624 Change-Id: I893362e049aedfa699043fcf27caf4815196f748
* Replace deprecated JobQueueGroup::singleton()Umherirrender2022-01-271-1/+1
| | | | Change-Id: Icdb301d352d302f70fefba9b40df2368cb217fd2
* [ChangesList] Time element in ChangesList should be consistently namedJon Robson2022-01-201-3/+7
| | | | | | | | | | | | Follow up to I0cba011f0ab8cb8fd59962b5eafb7650deefe841 This class is usually used for dates. In Special:Contributions an additional class is used for times so let's use that here. This will be helpful for T219349 Change-Id: Ibd5cff5cc37bec8eb840d7f0479fcb4eb8346611
* Explicit cast TS_UNIX to int for arithmetic operations and int argsUmherirrender2022-01-113-3/+3
| | | | | | | | When the called function has a doc of int, it should be cast to be explicit here. Also cast for arithmetic operations to be explicit about the number Change-Id: I905b78dfb66e66443e0e3203488bab5b548db543
* Merge "ChangesList: Add .mw-changeslist-time (no date) to output to each row"jenkins-bot2022-01-101-1/+4
|\
| * ChangesList: Add .mw-changeslist-time (no date) to output to each rowjdlrobson2022-01-101-1/+4
| | | | | | | | | | Bug: T298639 Change-Id: I0cba011f0ab8cb8fd59962b5eafb7650deefe841
* | Refactor global variables to use MediaWikiServices insteadTChin2022-01-106-36/+50
|/ | | | | | | | | | | | Automatically refactors wg prefixed globals to use MediaWikiServices config using Rector. Doesn't include files that set globals or files that fail CI. Rector Gist: https://gist.github.com/tchin25/7cc54f6d23aedef010b22e4dfbead228 * This patch uses a modified source code rector library for our specific use case and the rector will have different effects without it. A writeup for future reference is here: https://meta.wikimedia.org/wiki/User:TChin_(WMF)/Using_Rector_On_MediaWiki Change-Id: I1a691f01cd82e60bf41207d32501edb4b9835e37
* Fix typos in comments (C-D)Siddharth VP2021-12-302-4/+4
| | | | Change-Id: I568fb93b53feb83f026d485136dd0d116d677f4f
* Merge "Call static ChangesList::isDeleted statically"jenkins-bot2021-12-171-6/+6
|\
| * Call static ChangesList::isDeleted staticallyUmherirrender2021-12-051-6/+6
| | | | | | | | | | | | | | Using static:: and not self::, because subclass EnhancedChangesList already calling it that way Change-Id: Ibc57bf9bbfdb86a0fe6a7dd18e9ff730b882dab5
* | Remove some more comments that literally repeat the codeThiemo Kreuz2021-12-091-1/+1
|/ | | | | | | | Nothing to learn from these. You can find a longer explanation in the comments in I93751e6. Change-Id: I195aae70fc282b58be5b18160783f27d38605d15
* Remove ActionAjaxAmir Sarabadani2021-12-011-0/+1
| | | | | Bug: T42786 Change-Id: I8bda0c281e1f4abbffbddb80ac74a6d61a034d28
* Fix missing history-deleted class for suppressed revision on changeslistUmherirrender2021-11-271-1/+1
| | | | | | | | For comment and content the class mw-history-suppressed is added additional, should be the same for the user. Follow-Up: I08f14f712479e1b170c606e2b64857f8386acd76 Change-Id: I7d477913952b9cc67314d1ec96f83db2846a74cb
* Remove or replace usages of "sane"Reedy2021-11-221-1/+1
| | | | | Bug: T254646 Change-Id: I096b2cf738a1395a14f1d47bcbed0c2c686c2581
* Drop User methods which were deprecated since 1.35vladshapik2021-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following User methods, deprecated in 1.35, have been removed: - ::isIP, - ::isIPRange, - ::isValidUserName, - ::isUsableName, - ::isCreatableName, - ::getCanonicalName, - ::addAutopromoteOnceGroups, - ::getDefaultOptions, - ::getDefaultOption, - ::getOptions, - ::getBoolOption, - ::getIntOption, - ::setOption - ::listOptionKinds - ::getOptionKinds, - ::resetOptions, - ::getEffectiveGroups, - ::getAutomaticGroups, - ::getFormerGroups User::GETOPTIONS_EXCLUDE_DEFAULTS has been removed, since it is used only in the description of User::getOptions. Bug: T277511 Depends-On: Ida05c22f81b30d9b46678e8ede3d531c38855d83 Change-Id: I72bbc2336f8ddbc66ce67226cd2d5baaa2f807d8
* language: Fix nullable documentation for property, args and return typesUmherirrender2021-10-201-1/+1
| | | | | | Change documentation to null or false where the type is allowed Change-Id: Ibc17388c065605defed0d3f0998971c9987ff63f
* Introduce CommentFormatterTim Starling2021-09-282-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CommentParser: * Move comment formatting backend from Linker to a CommentParser service. Allow link existence and file existence to be batched. * Rename $local to $samePage since I think that is clearer. * Rename $title to $selfLinkTarget since it was unclear what the title was used for. * Rename the "autocomment" concept to "section link" in public interfaces, although the old term remains in CSS classes. * Keep unsafe HTML pass-through in separate "unsafe" methods, for easier static analysis and code review. CommentFormatter: * Add CommentFormatter and RowCommentFormatter services as a usable frontend for comment batches, and to replace the Linker static methods. * Provide fluent and parametric interfaces. Linker: * Remove Linker::makeCommentLink() without deprecation -- nothing calls it and it is obviously an internal helper. * Soft-deprecate Linker methods formatComment(), formatLinksInComment(), commentBlock() and revComment(). Caller migration: * CommentFormatter single: Linker, RollbackAction, ApiComparePages, ApiParse * CommentFormatter parametric batch: ImageHistoryPseudoPager * CommentFormatter fluent batch: ApiQueryFilearchive * RowCommentFormatter sequential: History feed, BlocklistPager, ProtectedPagesPager, ApiQueryProtectedTitles * RowCommentFormatter with index: ChangesFeed, ChangesList, ApiQueryDeletedrevs, ApiQueryLogEvents, ApiQueryRecentChanges * RevisionCommentBatch: HistoryPager, ContribsPager Bug: T285917 Change-Id: Ia3fd50a4a13138ba5003d884962da24746d562d0
* Title: Make use of BacklinkCacheFactory serviceDerick Alangi2021-09-091-2/+9
| | | | Change-Id: I48161585de6f329ec4037156234e0b07b3b837e6