aboutsummaryrefslogtreecommitdiffstats
path: root/includes/revisiondelete
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Use Authority for revision audience where possiblePetr Pchelko2021-02-241-19/+9
| | | | | Depends-On: I963a79d94b9e39086940a43945def7c8eff1536d Change-Id: If99d428b391c0eaf61396565af7f38740bef6c4a
* Introduce ActorStore, ActorLookup and ActorFactory.Petr Pchelko2021-02-081-1/+6
| | | | | | | | | | | | | | | | | | The ActorNormalization factory methods create UserIdentityValue from the database rows, either via fields of a joined table, or via a row from actor table. They assume that the actor_id exist and throw othervise. ActorNormalization is a storage-layer service providing access to finding and acquiring actor_id. The UserIdentityLookup methods do not instantiate new actor on demand, they just find an appropriate row in the actor table and return the result. Bug: T272689 Depends-On: I74d81f3f0233efb17fc8df5178e4c477cc669c6f Change-Id: Icfa1daca960c696a8cef8adab5eab53985802858
* Add dependency injection to RevDelList classesDannyS7122020-12-117-43/+294
| | | | | Bug: T268713 Change-Id: I9ee516f4aa35e493a630299e8ba2c60edd4f06ba
* Remove RevisionDeleter::checkRevisionExistenceDannyS7122020-12-011-26/+0
| | | | | Bug: T268714 Change-Id: I5ae5c40761e6a534be85a7a068e6aa5933b043e6
* Document hook names in hook interfaces.daniel2020-09-271-0/+3
| | | | | Bug: T258665 Change-Id: Ifddbf57f8aa2e3eb0d5845601376cbafa08ed407
* Replace "@stable for implementation" with "@stable to implement"daniel2020-07-131-1/+1
| | | | | | | | | | | For compliance with the new version of the table interface policy (T255803). This patch was created by an automated search & replace operation on the includes/ directory. Bug: T257789 Change-Id: I17e5e92e24c708ffc846945a136347670a3a20c7
* Hooks::run() call site migrationTim Starling2020-05-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate all callers of Hooks::run() to use the new HookContainer/HookRunner system. General principles: * Use DI if it is already used. We're not changing the way state is managed in this patch. * HookContainer is always injected, not HookRunner. HookContainer is a service, it's a more generic interface, it is the only thing that provides isRegistered() which is needed in some cases, and a HookRunner can be efficiently constructed from it (confirmed by benchmark). Because HookContainer is needed for object construction, it is also needed by all factories. * "Ask your friendly local base class". Big hierarchies like SpecialPage and ApiBase have getHookContainer() and getHookRunner() methods in the base class, and classes that extend that base class are not expected to know or care where the base class gets its HookContainer from. * ProtectedHookAccessorTrait provides protected getHookContainer() and getHookRunner() methods, getting them from the global service container. The point of this is to ease migration to DI by ensuring that call sites ask their local friendly base class rather than getting a HookRunner from the service container directly. * Private $this->hookRunner. In some smaller classes where accessor methods did not seem warranted, there is a private HookRunner property which is accessed directly. Very rarely (two cases), there is a protected property, for consistency with code that conventionally assumes protected=private, but in cases where the class might actually be overridden, a protected accessor is preferred over a protected property. * The last resort: Hooks::runner(). Mostly for static, file-scope and global code. In a few cases it was used for objects with broken construction schemes, out of horror or laziness. Constructors with new required arguments: * AuthManager * BadFileLookup * BlockManager * ClassicInterwikiLookup * ContentHandlerFactory * ContentSecurityPolicy * DefaultOptionsManager * DerivedPageDataUpdater * FullSearchResultWidget * HtmlCacheUpdater * LanguageFactory * LanguageNameUtils * LinkRenderer * LinkRendererFactory * LocalisationCache * MagicWordFactory * MessageCache * NamespaceInfo * PageEditStash * PageHandlerFactory * PageUpdater * ParserFactory * PermissionManager * RevisionStore * RevisionStoreFactory * SearchEngineConfig * SearchEngineFactory * SearchFormWidget * SearchNearMatcher * SessionBackend * SpecialPageFactory * UserNameUtils * UserOptionsManager * WatchedItemQueryService * WatchedItemStore Constructors with new optional arguments: * DefaultPreferencesFactory * Language * LinkHolderArray * MovePage * Parser * ParserCache * PasswordReset * Router setHookContainer() now required after construction: * AuthenticationProvider * ResourceLoaderModule * SearchEngine Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
* Add missing public visibility on some methodsUmherirrender2020-05-081-1/+1
| | | | | | RSSFeed::formatTime and AtomFeed::formatTime are private Change-Id: I6bf081c31c92e7130ae0ae527ba4a8f4635c7de2
* Remove use of Revision objects in RevisionItem classesDannyS7122020-05-054-19/+25
| | | | | | Bug: T249393 Bug: T249021 Change-Id: I1e240adb2799978b7f4302f90e43f7d337a0fdd9
* Replace various uses of Revision objectsDannyS7122020-05-011-31/+50
| | | | | | | | | | Each file's changes are independent of the other files and can be reviewed separately. Bug: T250579 Bug: T250714 Bug: T250580 Change-Id: I223dd6dfba27e560aff89be6705d91c40c550dd8
* Hook interface doc comment followupTim Starling2020-04-211-1/+1
| | | | | | Mostly just narrower array types. A handful of other errors fixed. Change-Id: Ied79d9e389867911bf83696dbb47f43305f8be7b
* docs: Hook interface doc comment reviewapaskulin2020-04-211-6/+8
| | | | | | | | Edited doc comments for hook interfaces to improve consistency and add type hints. Bug: T246855 Change-Id: I38fa802463cd6f39bf5946dbbeb1b3ebaea604b2
* Automatically generated hook interfacesTim Starling2020-04-201-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add hook interfaces which were generated by a script which parses hooks.txt and identifies caller namespaces and directories. Hook interfaces are mostly placed in a Hook/ subdirectory relative to the caller location. When there are callers in multiple directories, a "primary" caller was manually selected. The exceptions to this are: * The source root, maintenance and tests, which use includes/Hook. Test hooks need to be autoloadable in a non-test request so that implementing test interfaces in a generic handler will not fail. * resources uses includes/resourceloader/Hook * The following third-level subdirectories had their hooks placed in the parent ../Hook: * includes/filerepo/file * includes/search/searchwidgets * includes/specials/forms * includes/specials/helpers * includes/specials/pagers Parameters marked as legacy references in hooks.txt are passed by value in the interfaces. Bug: T240307 Change-Id: I6efe2e7dd1f0c6a3d0f4d100a4c34e41f8428720
* Pass RevisionRecord to Linker methodsDannyS7122020-04-181-2/+2
| | | | | | | | | | | Hard deprecation of passing Revision objects will follow soon, but until that is ready core calls can be updated There is some code cleanup that could be done around the calls, but to simplify review no other changes are made. Bug: T249561 Change-Id: Ifcfb3811650decffeaa87dc033c41fd1710b47a6
* Add small HtmlCacheUpdater service class to normalize purging code (2)Aaron Schulz2020-04-142-5/+6
| | | | | | | | | | | | | | | | | | | This is a re-submit of 35da1bbd7cb, which was accidentally merged before CR (and reverted with aa4da3c2e8e). The purge() method handles purging of both file cache and CDN, using a PRESEND deferred update. This avoids code duplication and missing file cache purge calls. Also: * Migrate HTMLCacheUpdate callers to just directly using HTMLCacheUpdateJob * Add HtmlFileCacheUpdate class and defer such updates just like with CDN * Simplify HTMLCacheUpdate constructor parameters * Remove BacklinkCache::clear() calls which do nothing since the backlink query does not actually happen until the job runs Bug: T230025 Change-Id: Ic1005e70e2c22d5bd1ca36dcdb618108ebe290f3