Commit graph

38 commits

Author SHA1 Message Date
Umherirrender
1b29f07440 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
2024-10-21 20:41:20 +02:00
Ebrahim Byagowi
64b7d2a03d Add MediaWiki\RevisionList namespace to the related classes
This patch introduces a namespace, MediaWiki\RevisionList, and adds it
to the related classes and establishes class aliases marked as
deprecated since version 1.43.

Bug: T353458
Change-Id: I1614a00dd8973c5300d95317a725cbe46e14d1af
2024-05-21 15:12:05 +03:30
Bartosz Dziewoński
4aebcfe097 Change more uses of getDBLoadBalancerFactory() to getConnectionProvider()
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 8604c384f6.

Change-Id: I6657d783375fac5c7fa856b884ff1fb09285e94c
2024-01-23 16:34:45 +01:00
Amir Sarabadani
2e1cd74ad2 Migrate off wfGetDB() in more places to ICP
This function is uber-deprecated, meaning even its replacement is
deprecated, We have already migrated in static functions and more.

In this batch, all calls have been migrated that there is already a call
to MediaWikiServices::getInstance() making the migration easier. Of
course in most cases, they should eventually turn into proper service
injection but this at least makes it clear what services should be
injected.

Also removing "category" group since we are removing all groups except a
handful from mw (see T263127 for more information).

Bug: T330641
Change-Id: I90cd35ee45a37eb6e6bf7a531cc8f75effbd0328
2023-11-20 14:40:28 +01:00
James D. Forrester
459cbb0494 Namespace remaining 'specialpage' files under \MediaWiki\SpecialPage
SpecialPageFactory is already here, but none of the others were yet.

Bug: T166010
Change-Id: I9689bf0a1ab329625e23669b99f019b96295fffd
2023-09-18 18:23:13 +01:00
Umherirrender
9edc925620 revisiondelete: Use correct rev-del constants in Item/List classes
Not use RevisionRecord constants for LogPage or File,
even the number are the same, the context should be the match

Change-Id: Icf50f48fa63144c5ac798e7453faf9cd0a1b706a
2023-07-24 17:30:57 +00:00
Amir Sarabadani
b55c501fe0 Migrate Database::update() to UpdateQueryBuilder
I did this using a script written on top of antlr4 parser so it doesn't
have some clean ups a human would do but it's pretty nice already.

Bug: T330640
Change-Id: I608566700c6d737ee986bf47dda87effc69614d6
2023-06-08 12:34:20 +02:00
Amir Sarabadani
7d8768e931 Reorg: Move HTML-related classes out of includes/ to Html/
Bug: T321882
Change-Id: I5dc1f7e9c303cd3f5b9dd7010d6bb470d8400a18
2023-02-16 20:40:01 +01:00
Umherirrender
6442e5b1cc revisionslists: Replace deprecated Linker::revComment/commentBlock
Bug: T324906
Change-Id: I0db8521f5ea0266a41687c46d7466a97fbc21742
2022-12-11 01:40:43 +01:00
Amir Sarabadani
2d60ba0c63 Reorg: Move DummyLinker and Linker to linker/
This feels like a no-brainer unless I'm missing something obvious

Bug: T321882
Change-Id: Id49c3d0dd6ea4593211048850856b5b8e05a8fb3
2022-12-08 06:38:17 +01:00
Umherirrender
a5abaeba10 Call IContextSource::getAuthority instead of IContextSource::getUser
Change to use Authority object where possible
to use the interface instead of implementation

Change-Id: Ia7e9ce2a2f05ef2ae1cf981bf96faf48b04cf58d
2022-06-29 22:22:44 +02:00
sbassett
29d5d95eaf SECURITY: properly escape output used within galleries and Special:RevisionDelete
* Sanitize $img->getDimensionsString() within TraditionalImageGallery.php

* Sanitize width, height, nbytes messages within RevDelFileItem.php

Bug: T297543
Change-Id: I586a052595ecdc976476d4330510750a59099648
2022-01-10 14:20:48 -06:00
Matěj Suchánek
50b010e5e8 Don't throw away '0' edit summary
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
2021-11-24 10:33:36 +00:00
Kunal Mehta
a85f569dd1 Revert "Use CsrfTokenSet as CSRF token source"
This reverts commit 0d75fdb4f7.

Bug: T287542
Change-Id: Iedd3461869f973f8d621a39e6ad4674cbb577551
2021-08-05 15:48:26 -07:00
Petr Pchelko
0d75fdb4f7 Use CsrfTokenSet as CSRF token source
Change-Id: I079d2c802d9b48d6abf7f37fa9ef7dafac631345
2021-07-12 14:19:15 -07:00
Petr Pchelko
5455e58967 Deprecate File::getUser in favor of File::getUploader
Change-Id: I8a45a8fdfa827f203e6bc123cb685d02c3612bb0
2021-06-02 09:06:09 -07:00
daniel
2a1087fa40 RevisionDeleter: Use PageIdentity instead of Title
RevDelList for now still uses a Title internally.

Change-Id: Id839ac697bd742e908f465cf5330da486dc73111
2021-05-06 13:42:13 +02:00
James D. Forrester
df5eb22f83 Replace uses of DB_MASTER with DB_PRIMARY
Just an auto-replace from codesniffer for now.

Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
2021-04-29 09:24:31 -07:00
Umherirrender
1e4108c0c6 Use MediaWikiServices::getRepoGroup in special page related classes
Change-Id: Ibc77da63fc36c0657d89a497fb8be867a617ea88
2020-03-14 12:35:10 +00:00
Daimona Eaytoy
41ee2f2c61 Upgrade phan to 0.9.1
Released just now.

Many old suppressions can now be removed. Enabling the issue for
undeclared variables is left to do later, given that there are
roughly 200 warning.

Change-Id: I99462a1e9232d6e75022912e2df82bc2038476ef
2020-01-25 10:53:26 +00:00
Daimona Eaytoy
598c4d7fcb build: Upgrade phan to 0.9.0
Scalar casts are still allowed (for now), because there's a huge amount
of false positives. Ditto for invalid array offsets.

Thoughts about the rest: luckily, many false positives with array offsets
have gone. Moreover, since *Internal issues are suppressed in the base
config, we can remove inline suppressions.

Unfortunately, there are a couple of new issues about array additions
with only false positives, because apparently they don't take
branches into account.

Change-Id: I5a3913c6e762f77bfdae55051a395fae95d1f841
2019-12-07 20:16:19 +00:00
Thiemo Kreuz
3c9acdff54 revisionlist: Strict type hints in RevisionItem constructors
Change-Id: Iab0bce89a9a4111eef217bbc1a8f1263f1ed796a
2019-10-25 15:37:26 +00:00
Umherirrender
f20768c186 Avoid use of private properties in RevDelFileItem::getApiData
Change-Id: I4cee26e4963588811221b36089760361af292527
2019-10-13 09:16:42 +00:00
Umherirrender
f74400487f phan: Disable enable_class_alias_support
It is enabled for b/c in extensions, but not needed in core

Change-Id: I51dca12be9c77049f77563d9bf0edd07928c2300
2019-09-15 08:26:52 +00:00
Derick Alangi
339211a1ea Avoid usage of deprecated Revision::* constants, use RevisionRecord
Change-Id: I872fc89e5c02dd6a3ae9cd7e76640b95dc33f514
2019-07-21 15:03:03 +01:00
Erik Bernhardson
08dba3de30 Remove PhanUndeclaredStaticMethod from blacklist
There was a single instance of this issue which was reasonably simple
to solve. The code that triggered the issue was not wrong, but calling
the grandparent constructor directly is not the cleanest code so it
seems right to fix it. Switch revision initialization into an
overridable function to remove the need to even have a constructor in
the class.

Change-Id: Ic2af0d93e8d55e93061e3f4b5c7a4122509543f0
2018-08-28 05:38:43 +00:00
Brad Jorsch
27c61fb1e9 Add actor table and code to start using it
Storing the user name or IP in every row in large tables like revision
and logging takes up space and makes operations on these tables slower.
This patch begins the process of moving those into one "actor" table
which other tables can reference with a single integer field.

A subsequent patch will remove the old columns.

Bug: T167246
Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50
Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
2018-02-23 10:06:20 -08:00
Thiemo Mättig
e16191caa3 Remove unused and unnecessary imports
Change-Id: I26e623a4e4ba965c07670369a90c8a95185ea1e4
2017-06-12 15:50:43 +00:00
Aaron Schulz
488a647831 Move IDatabase/IMaintainableDatabase to Rdbms namespace
Change-Id: If7e8a8ff574661fd827de8bcec11d2c39a687300
2017-03-28 15:32:38 -07:00
Brad Jorsch
96b60ded77 Fix RevDel API output for formatversion=2
Use booleans, not the old empty-string-or-undefined.

This bugfix is a breaking change, but chances are it won't affect many
clients.

Bug: T153518
Change-Id: If5fa2cdcb973b186349307b29e4266daceef0a9d
2016-12-19 11:48:49 -05:00
divadsn
870d05e408 Replace Linker::link() with LinkRenderer in all revisiondelete pages
* RevDelArchiveItem
* RevDelArchivedFileItem
* RevDelFileItem
* RevDelLogItem
* RevDelRevisionItem

Bug: T149346
Change-Id: I96f83d06b4d3ccf3f76ccfca843a6aaf76d89063
2016-12-06 19:25:14 +00:00
Aaron Schulz
56f14e2b5d Fix inconsistent RevDelFileItem visibilities
Bug: T142228
Change-Id: Ib5a0a1adbea2daf2b035cf6be367841362de03cc
2016-08-05 22:42:12 +00:00
Aaron Schulz
d217cdf4b5 Make revision deletion acquire file locks to avoid races
Also made RevisionListBase an Iterator to avoid ugly loops here

Change-Id: I40d2d8cf63df95c59d0e1275e3ec45aff238e1cb
2016-07-26 16:32:15 -07:00
Kunal Mehta
5e11a28e7a Title::getLinkURL(): Allow expanding PROTO_RELATIVE too
Allow callers to get protocol-relative URLs by passing the
PROTO_RELATIVE constant. Since most callers don't pass in $proto, this
shouldn't change very much since the default of non-expanded is
effectively the same, but expanding to a protocol-relative URL when it
is not intended should still be safe.

A few callers that explicitly specified the default in core were also
updated.

Change-Id: I214f17aa6e8e30b647f21f0951fc3a15e87850c7
2016-07-01 11:31:56 -07:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
addshore
6b40bbe016 Fix phpcs issues in actions and revisiondelete dirs
Change-Id: I54c1e336b8c44ff8720ac38c8b2d68ede42af305
2014-08-12 22:53:14 +00:00
umherirrender
c518dd36c5 Restore formatting before split of RevisionDelete.php
I244a66fe19c089df4bcabcf745536d99b2103bc4 splitted RevisionDelete.php in
11 files, but that removed code formatting and produced long lines.
Restored code formatting and added newline at end of files.

Change-Id: I51ab4181b723b46a806dad4752420e6bfc530133
2014-08-08 15:55:19 +02:00
Reedy
be02da8e1a Split RevisionDelete.php to separate files
Change-Id: I244a66fe19c089df4bcabcf745536d99b2103bc4
2014-08-07 20:46:46 +00:00