aboutsummaryrefslogtreecommitdiffstats
path: root/includes/revisiondelete
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix even more PHPStorm inspections (#3)Tim Starling2023-03-255-5/+10
| | | | | | | | | | | | | | | * Inappropriate @inheritDoc usage. Arguably all @inheritDoc is inappropriate but these are the ones PHPStorm flags as misleading due to the method not being inherited. * Doc comment type does not match actual argument/return type. * I replaced "@return void|never" with "@return void" since never means never, it doesn't make sense for it to be conditional. If a method can return (even if that is unlikely) then @return contains the type that it returns. "@return never" means that there is no such type because the method never returns. * Incomplete/partial/broken doc tags Change-Id: Ide86bd6d2b44387f37d234c2b059d6fbc42ec962
* Reorg: Namespace the Title classJames D. Forrester2023-03-026-1/+6
| | | | | | | | | | | | | | | | | | | 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
* Switch some simple use of LoadBalancer to use new LBFactory methodsAmir Sarabadani2023-02-232-3/+3
| | | | | Bug: T326274 Change-Id: I837f7a7b0fad4353dbd670eec609fedfd0603af1
* Reorg: Move HTML-related classes out of includes/ to Html/Amir Sarabadani2023-02-161-0/+1
| | | | | Bug: T321882 Change-Id: I5dc1f7e9c303cd3f5b9dd7010d6bb470d8400a18
* revisiondelete: Reuse LogFormatter::getComment instead of own formattingUmherirrender2023-02-091-9/+2
| | | | | | | | | | | Avoid code duplication and allows to use the new styling if Icfb46d9 (T327538) gets merged Remove duplication of span.history-deleted on Special:EditTags - before this change a span.history-deleted element was nested inside another span.history-deleted element and after this change it is not. Change-Id: I2e27bd8e0bcca47a7734fcb6ee28c0d1e6bb5896
* revisiondelete: Replace dynamic property Status::$itemStatusesUmherirrender2023-02-041-3/+3
| | | | | | | Creation of dynamic property Status::$itemStatuses is deprecated Bug: T314099 Change-Id: I5fc1496aa38502143a3511a6a8a110eb9446a2a9
* Replace some usages of MWExceptionDaimona Eaytoy2023-01-261-1/+1
| | | | | | | | These exceptions are not documented with @throws and they're really not meant to be caught. Bug: T86704 Change-Id: I07f32e42c6fd4bc8785bac91547858f15a9fc2a8
* Remove now unused (bogus) cache key in RevDelRevisionListThiemo Kreuz2023-01-113-17/+3
| | | | | | | | | Unused since Idbb5a5a. Note it never worked because of a misplaced } at the end. Bug: T238374 Change-Id: Ic8759a78d02fb5d3d600443445ba5122d512794b
* Split a base class out of CommentStoreAlexander Vorwerk2023-01-012-0/+2
| | | | | | | | | | so that extensions (i.e. CheckUser) can implement their own comment store without having a lot of code duplication basically the comment store version of I3a6486532f2ef36 Bug: T233004 Change-Id: Ib40f99e00a514d41776ce521baf113e46d37e9cd
* revisionslists: Replace deprecated Linker::revComment/commentBlockUmherirrender2022-12-112-2/+4
| | | | | Bug: T324906 Change-Id: I0db8521f5ea0266a41687c46d7466a97fbc21742
* Reorg: Move DummyLinker and Linker to linker/Amir Sarabadani2022-12-082-0/+2
| | | | | | | This feels like a no-brainer unless I'm missing something obvious Bug: T321882 Change-Id: Id49c3d0dd6ea4593211048850856b5b8e05a8fb3
* Remove RevDelList::reloadFromMasterMatěj Suchánek2022-11-281-8/+0
| | | | | | It has been deprecated since 1.37 and it is unused. Change-Id: I9f6ff3a656637528ad2f76cbd77e6980737e03c3
* Merge "Sort logging table by timestamp and log id"jenkins-bot2022-10-261-1/+1
|\
| * Sort logging table by timestamp and log idUmherirrender2022-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Sorting on log_id must not give a result in time order, because maintenance scripts can insert newer ids with older timestamps. When only sorting for log_timestamp the result is not stable, because for items with same timestamp the order is not defined. For Special:Log the same timestamp gives problems on pagination Bug: T305590 Change-Id: Ic0c2ebd19ee6a8aa570c5a12a92b31008135491c
* | 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
* Call IContextSource::getAuthority instead of IContextSource::getUserUmherirrender2022-06-292-5/+5
| | | | | | | Change to use Authority object where possible to use the interface instead of implementation Change-Id: Ia7e9ce2a2f05ef2ae1cf981bf96faf48b04cf58d
* Show change tags for log entries on Special:RevisionDeleteUmherirrender2022-05-312-9/+37
| | | | | | | | When revdel/suppress a log entry the change tags should be shown as shown on Special:Log for the same log entry. Bug: T109041 Change-Id: Ia2c89869008593ff765f06e61e0186b78539c18c
* Merge "Start clean up of revision_actor_temp table"jenkins-bot2022-05-231-29/+6
|\
| * Start clean up of revision_actor_temp tableAmir Sarabadani2022-05-231-29/+6
| | | | | | | | | | | | | | It is being dropped in production Bug: T215466 Change-Id: I66b2cb8653252e720c897351065978119f040ba7
* | Merge "revisionlist: Store page identity instead of Title"jenkins-bot2022-05-234-14/+19
|\ \ | |/ |/|
| * revisionlist: Store page identity instead of TitleUmherirrender2022-04-164-14/+19
| | | | | | | | | | | | | | | | The function deprecatePublicPropertyFallback is needed when the deprecated class property no longer exists. Just store the PageIdentity and fallback to title if needed. Change-Id: I48f81e80c3cdd91f34da9d71344660ab5d27bda2
* | Use MainConfigNames instead of string literals, #2Aryeh Gregor2022-04-131-1/+2
|/ | | | | | | This covers all occurrences of /onfig->.*get( '/ in includes/. Undoubtedly there are still plenty more to go. Change-Id: I33196c4153437778496f40436bcde399638ac361
* Fix various documentation related to null typesUmherirrender2022-02-261-3/+3
| | | | | | | | The functions returning null or the class property is set explict null Found by phan strict checks Change-Id: I4a271093fb6526564d8083a08249c64cb21f2453
* revisiondelete: make RevDelList use cancelAtomic() instead of ↵Aaron Schulz2022-02-211-2/+2
| | | | | | | rollbackPrimaryChanges Bug: T297424 Change-Id: Id20d94d0ccc564038a1cd126f6675167929dbd55
* Don't double-escape the ellipses in Language::truncateForVisual()C. Scott Ananian2022-02-101-3/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "SECURITY: properly escape output used within galleries and ↵jenkins-bot2022-01-101-2/+4
|\ | | | | | | Special:RevisionDelete"
| * SECURITY: properly escape output used within galleries and ↵sbassett2022-01-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | Special:RevisionDelete * Sanitize $img->getDimensionsString() within TraditionalImageGallery.php * Sanitize width, height, nbytes messages within RevDelFileItem.php Bug: T297543 Change-Id: I586a052595ecdc976476d4330510750a59099648
* | Refactor global variables to use MediaWikiServices insteadTChin2022-01-101-2/+4
|/ | | | | | | | | | | | 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
* 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
* Don't throw away '0' edit summaryMatěj Suchánek2021-11-242-2/+2
| | | | | | | | Those "$comment ?? ''" are a bit ugly, but the other way around is changing the return values of some ::getDescription implementations, which is dangerous, at least. Change-Id: I07e6b58258c256d19b058c56280150b70a46b407
* Remove or replace usages of "sanity"Reedy2021-11-191-1/+1
| | | | | Bug: T254646 Change-Id: I2b120f0b9c9e1dc1a6c216bfefa3f2463efe1001
* build: Update mediawiki/mediawiki-phan-config to 0.11.0Umherirrender2021-09-071-1/+0
| | | | | | | Addition and remove of suppression needs to be done with the version update. Change-Id: I3288b3cefa744b507eadebb67b8ab08c86517c1c
* RevDelList: Rename reloadFromMaster to reloadFromPrimaryJames D. Forrester2021-09-031-1/+10
| | | | | | | Hard-deprecating immediately as no known users in git outside of this repo. Bug: T282894 Change-Id: I2a28394b3a5126bad8dbcfe4b0e4665d009132d7
* ILoadBalancer/ILBFactory: Rename rollbackMasterChanges to rollbackPrimaryChangesJames D. Forrester2021-09-021-1/+1
| | | | | Bug: T282894 Change-Id: I31794e052d71160195dd3b6c29fea24bc98b356b
* Revert "Use CsrfTokenSet as CSRF token source"Kunal Mehta2021-08-052-8/+5
| | | | | | | This reverts commit 0d75fdb4f73ddbf4ad5f29e14258d58e507d55b4. Bug: T287542 Change-Id: Iedd3461869f973f8d621a39e6ad4674cbb577551
* Replace deprecated CommentStore::getStore in RevDelLogItemUmherirrender2021-08-042-8/+21
| | | | Change-Id: Id47e0fa26f1846be0313288275c903ab073c50bb
* build: Updating dependencieslibraryupgrader2021-07-221-1/+1
| | | | | | | | | | | | | | composer: * mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0 The following sniffs now pass and were enabled: * Generic.ControlStructures.InlineControlStructure * MediaWiki.PHPUnit.AssertCount.NotUsed npm: * svgo: 2.3.0 → 2.3.1 * https://npmjs.com/advisories/1754 (CVE-2021-33587) Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
* More master -> primary documentation and internal var renamingJames D. Forrester2021-07-151-1/+1
| | | | | Bug: T254646 Change-Id: I63cc8895033714bdfbf09aee933a8f0a43b387f3
* Schema migration for revison_actor_temp table removalTim Starling2021-07-141-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new schema migration stage in which rev_actor is used directly and the revision_actor_temp table is no longer needed. This becomes the new "new" stage whereas the previous situation is now termed SCHEMA_COMPAT_TEMP. Introduce migrateRevisionActorTemp which copies data from revision_actor_temp to rev_actor. The code is similar to migrateImageCommentTemp.php except that it doesn't delete from the old table. Partial revert of c29909e59fd89d9fc6. That change removed direct references to $wgActorTableSchemaMigrationStage and made queries involving revision_actor_temp be unconditional. Such changes need to be reverted to make the use of revision_actor_temp be conditional again. In ActorMigrationTest, I compacted provideGetJoin() and provideGetWhere(), removing most of the duplication between expected values. I gave all the stages a short name, and mostly used the name in providers. Bug: T275246 Change-Id: I7498107dd6433ab7de5bf2e7b3fe2aa5e10e345d
* Use CsrfTokenSet as CSRF token sourcePetr Pchelko2021-07-122-5/+8
| | | | Change-Id: I079d2c802d9b48d6abf7f37fa9ef7dafac631345
* Post Revision-removal cleanupDannyS7122021-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updates for the removal of the Revision class itself and the various methods/hooks/variables removed in the process, including: - Update some documentation removing most references to the Revision class and updating the MCR migration notes to reflect the past tense for Revision methods. - Change some capitalization from "Revision" to "revision" to make it clear comments are about revisions in general, not the Revision class in particular. - Minor code tweaks including removing unused variables that were around for the old hooks that were removed, and removing the use of DeprecatablePropertyArray where no longer needed for anything. - Fix incorrect documentation for PageUpdater::getStatus(), the status value changed a while ago to have revision-record in addition to revision, and recently to only have the revision-record, but ironically PageUpdater was never updated. - Removed Parser::$mRevisionObject, used to be a Revision object and was deprecated in 1.35, missed earlier because it was no longer being set to Revision objects, always null. - Add RevisionRecord typehints in DummyLinker to match those in the corresponding Linker methods This should be a no-op in terms of functionality. Bug: T247143 Change-Id: I03bbb94fc29085855448780b1a5ad9063911ecc4
* Use array_fill_keys() instead of array_flip() if that reflects the ↵Tim Starling2021-06-151-1/+1
| | | | | | | | | | | | | | | | | | developer's intention array_fill_keys() was introduced in PHP 5.2.0 and works like array_flip() except that it does only one thing (copying keys) instead of two things (copying keys and values). That makes it faster and more obvious. When array_flip() calls were paired, I left them as is, because that pattern is too cute. I couldn't kill something so cute. Sometimes it was hard to figure out whether the values in array_flip() result were used. That's the point of this change. If you use array_fill_keys(), the intention is obvious. Change-Id: If8d340a8bc816a15afec37e64f00106ae45e10ed
* ArchivedFile: replace ::getUser methods with ::getUploaderPetr Pchelko2021-06-041-5/+7
| | | | Change-Id: I43ea7be80e8546e217d6aa371bb48f0699129cc4
* Deprecate File::getUser in favor of File::getUploaderPetr Pchelko2021-06-021-11/+13
| | | | Change-Id: I8a45a8fdfa827f203e6bc123cb685d02c3612bb0
* Using RevisionListBase::getPage instead of calling $title directlyZabeMath2021-05-131-2/+2
| | | | | Bug: T282825 Change-Id: I9966b206b053c8227e619521b5ad69561198443e
* RevisionDeleter: Use PageIdentity instead of Titledaniel2021-05-0610-34/+41
| | | | | | RevDelList for now still uses a Title internally. Change-Id: Id839ac697bd742e908f465cf5330da486dc73111
* Replace uses of DB_MASTER with DB_PRIMARYJames D. Forrester2021-04-299-10/+10
| | | | | | Just an auto-replace from codesniffer for now. Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
* Merge "Add classes to when a linked change is suppressed"jenkins-bot2021-04-291-1/+2
|\
| * Add classes to when a linked change is suppressedAmir Sarabadani2021-04-291-1/+2
| | | | | | | | | | | | | | | | | | | | This also tries to centralize adding logic of adding history-deleted class as well. To make future changes easier. This doesn't affect history deletion on files, recentchanges, and logs yet Bug: T23272 Change-Id: I08f14f712479e1b170c606e2b64857f8386acd76
* | Stop using legacy ActorMigration field "log_user"Tim Starling2021-04-283-13/+11
|/ | | | | Bug: T278917 Change-Id: I1b78bad7e1fa43f5f82908567a7daad9c6cc79b9