Commit graph

7635 commits

Author SHA1 Message Date
Petr Pchelko
92a88e4e07 Special:Contributions - verify early year and month are ints
Bug: T293293
Change-Id: I96cf8a24a329dad26e2bf76bf4495c192e296577
2021-11-01 19:16:12 -07:00
Maggie Epps
850dcfa4bb Watchlist: Add space in filters checkbox
Uses \n string to manually create space between checkboxes and labels

Bug: T286262
Change-Id: I9a00a3f26f8c6faa854652c60cb9429e6b92d67d
2021-11-01 12:49:10 +00:00
Meno25
1c936cb662 Update link target
Link redirected on website

Change-Id: Ib7dafdf63dfe1240b2f78c9296999db6ef454ed3
2021-10-16 19:26:02 +00:00
jenkins-bot
ae5c51f354 Merge "Use Message::sizeParams to simplify code when building messages" 2021-10-15 23:21:38 +00:00
jenkins-bot
71be145b96 Merge "AllMessagesTablePager: Avoid double class mw-datatable" 2021-10-14 21:45:49 +00:00
TChin
fb4e7a803a Add message parameter type for User Groups
Bug: T278482
Change-Id: I45da5f73f8920b79b57c02776a05d0268d3480f2
2021-10-14 15:02:13 -04:00
Umherirrender
02c0e8b8e7 Use Message::sizeParams to simplify code when building messages
Change-Id: Ic04d4dea86e61fb07b2a3b17acb6021fab6ae5ee
2021-10-13 19:52:41 +00:00
jenkins-bot
5535b42559 Merge "Add SpecialExportGetExtraPagesHook" 2021-10-11 22:00:33 +00:00
Fomafix
33720e7683 AllMessagesTablePager: Avoid double class mw-datatable
This change replaces in the HTML of Special:AllMessages
  <table class="mw-datatable mw-datatable" id="mw-allmessagestable">
by
  <table class="mw-datatable" id="mw-allmessagestable">

Remove unnecessary space at the start of the value of the class
attribute in TablePager.

Inline the one-time used variable
  $tableClass = $this->getTableClass()

Change-Id: I4353d47bda3136cd3a8341677a0288f59895d5c6
2021-10-09 16:59:10 +00:00
DannyS712
b9663bed45 Convert TrackingCategories to a service with DI
Bug: T247194
Change-Id: I50012e2a5e65aeee7671023d2fd5367e21e8ae67
2021-10-08 16:36:20 -04:00
Cindy Cicalese
37a9e60ca5 Add SpecialExportGetExtraPagesHook
This hook allows extensions to add additional pages to the list of
pages being exported. For example, if an extension creates supplemental
pages that must be exported along with a content page, this hook will
allow the extension to export the supplemental pages automatically when
the content page is exported.

Bug: T292378
Change-Id: I3b6b466b6ed32b1939674872df9e431bd6941645
2021-10-04 10:33:04 -04:00
C. Scott Ananian
df3cc40fac Rename ParserOutput::{allow,prevent}Clickjacking() -> ::{get,set}PreventClickjacking()
This name is consist with the rest of the setter and getter methods
in ParserOutput.  Renamed the methods in OutputPage, ImageHistoryList,
ImageHistoryPseudoPager, and ContribsPager as well for consistency;
it also makes chasing down lingering references in codesearch easier.

Soft-deprecated the old name for 1.38.  Hard-deprecation will follow,
but there are a number of users in production that should be chased
down first.

Code search:

https://codesearch.https://codesearch.wmcloud.org/deployed/?q=(allow%7Cprevent)Clickjacking&i=nope&files=&excludeFiles=&repos=

Bug: T287216
Change-Id: I9822c60c180d204bd30cb4447a1120155d456da4
2021-10-01 14:13:47 -04:00
jenkins-bot
f5e8e6e386 Merge "SpecialMovePage: stop falling back to global state" 2021-10-01 16:53:49 +00:00
jenkins-bot
5e1b0d147d Merge "Pass int[] to RevisionStore::getRevisionSizes" 2021-10-01 16:43:34 +00:00
jenkins-bot
e2861ca8bb Merge "Replace deprecated User function in ChangesListSpecialPage" 2021-10-01 15:17:39 +00:00
Alexander Vorwerk
c717e983ae SpecialMovePage: stop falling back to global state
MovePageForm is no longer being extended in extensions, thus a fallback
to global state is no longer necessary.

Bug: T259960
Bug: T265945
Change-Id: I585dd8129864a20c844fe4c29943e9d639b5ae2d
2021-10-01 13:33:48 +00:00
Umherirrender
6541f20e2d Replace deprecated User function in ChangesListSpecialPage
Call the UserFactory only for registed users
Changed static property to abstract function similar to
0d48f7d25b

Bug: T277600
Change-Id: I07934d0c1c172c4f7e15d9922c7929a6e8dbc0df
2021-10-01 12:01:33 +00:00
jenkins-bot
c17eaaa54c Merge "Remove UndeleteForm::undelete hook" 2021-10-01 00:57:48 +00:00
Daimona Eaytoy
e021602204 Remove UndeleteForm::undelete hook
Bug: T290021
Change-Id: If684bd5967825591cc3e21243e23a73e06da2179
2021-09-30 22:20:23 +00:00
Chris Danis
781caf83db SECURITY: fix PoolCounter protection of Special:Contributions
The call to $pager->getNumRows() itself triggers execution of
the database query backing the page, so, that call must be inside
the callback given to PoolCounterWorkViaCallback.

CVE-2021-41800

Bug: T284419
Change-Id: I8b7b41a355be265389a4a8c9ea91301d4e23ae1b
2021-09-30 22:19:16 +00:00
jenkins-bot
10490802e7 Merge "Change null to [] for html attributes on call of Html functions" 2021-09-29 16:20:41 +00:00
Umherirrender
227e2432e1 Pass int[] to RevisionStore::getRevisionSizes
The database result is always a string, cast to int before passing to
getRevisionSizes, which is documented to take int[]

Change-Id: Iead5787a596e0264b769a97f1c79c1abe5c482f4
2021-09-28 23:25:58 +02:00
jenkins-bot
85f805bb6b Merge "Deprecate the UndeleteForm::undelete hook" 2021-09-28 19:21:39 +00:00
Tim Starling
f7f84dddb3 Introduce CommentFormatter
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
2021-09-28 11:13:03 -07:00
Daimona Eaytoy
eedd8a7774 Deprecate the UndeleteForm::undelete hook
It allowed replacement of the PageArchive object, which is so horrific
that I'm going to have nightmares for a while after seeing that code.

A new hook, PageUndelete, was added to give users something to migrate
to that is also used by API requests etc, and for symmetry with
DeletePage.

This change needs to be in 1.37, since the capability of replacing
PageArchive will be removed in 1.38 by the addition of the UndeletePage
service. Note that in 1.37, errors from the status will not be used
since PageArchive::undeleteAsUser returns false in case of errors.

The only usage of this hook in WMF production (ext:Newsletter) is fixed
in a dependent patch. A non-WMF usage in ext:Video is not fixed since
that one does replace PageArchive and I'd rather not mess with that.

SpecialUndelete has two other similar hooks that pass a PageArchive by
reference, but in those places PageArchive is used as a lookup (not an
undeletion command), so they're not affected by the ongoing undeletion
work, and we cannot deprecate them since we'd have to provide
replacements first. I've left some comments anyway.

Bug: T290021
Change-Id: If434c7ff9de92482f84d535baae5139c18081174
2021-09-28 15:40:50 +00:00
jenkins-bot
ca03262e0b Merge "Use mw.Title for capitalizing and drop wgCapitalizeUploads" 2021-09-27 19:36:36 +00:00
jenkins-bot
5c570f46da Merge "Move code from PageArchive to a new UndeletePage command" 2021-09-27 14:22:05 +00:00
jenkins-bot
49feba77f4 Merge "Ignore pages that can't exist on Special:ListRedirects" 2021-09-26 19:49:32 +00:00
jenkins-bot
86fa9b40a5 Merge "Inject UserIdentityLookup into SpecialLog" 2021-09-26 19:22:47 +00:00
Alexander Vorwerk
0f2008bcd8 Inject UserFactory into special pages
Change-Id: I2ca5c6bdec1bbf0c64270e55d29151f75935d480
2021-09-25 19:06:57 +02:00
Alexander Vorwerk
fd094c5bb7 Inject UserIdentityLookup into SpecialLog
Change-Id: Ifc17a7ef38da60ec1534b39df1657f2394cbcb59
2021-09-25 18:36:37 +02:00
Alexander Vorwerk
d0c4c0138a Ignore pages that can't exist on Special:ListRedirects
Bug: T279840
Change-Id: I6218b2a66d85ba7af33f6fb0951a5fd1d87fcd0c
2021-09-25 14:38:12 +00:00
Umherirrender
769bdbf091 docs: Fix nullable documentation for class properties
Change-Id: I6d0577124d852103f485ffdc819876a13f6641c3
2021-09-24 00:54:53 +00:00
Umherirrender
362a48e316 Change null to [] for html attributes on call of Html functions
Change-Id: Ia84f5b1f210396cba5daa7b9e8bb8c4069e0171d
2021-09-22 22:47:28 +02:00
Daimona Eaytoy
beadd4454f Move code from PageArchive to a new UndeletePage command
This is just moving code verbatim, removing now-unneeded stuff, and
duplicating tests as well.

Bug: T290021
Change-Id: I540ddaaa11dfabcf0b87b608b151b5e34d199fd8
2021-09-21 16:11:29 +00:00
Umherirrender
89bd837f92 Escape return of Language::formatNum
Also fix docs of ImageListPager::formatValue:
There is no int or Message type, the int is converted to string by
formatNum() and the Message by escaped()

Change-Id: I7cbff8644cd5a92ff2f459adb987a3c076ad648f
2021-09-21 00:38:01 +02:00
Fomafix
5427978d0b Use mw.Title for capitalizing and drop wgCapitalizeUploads
mw.Title makes already a capitalizing of the first character based on
the namespace in wgCaseSensitiveNamespaces and also the replacement of
' ' by '_'.

The JavaScript variable wgCapitalizeUploads is not needed anymore.

Change-Id: Ic463c2cd6de51589b3cb61fe532d6f09b1a7d1f8
2021-09-20 10:32:14 +00:00
jenkins-bot
c6b5410e27 Merge "Show autoblock duration in the form at Special:Block" 2021-09-17 18:57:41 +00:00
Inductiveload
d0714065de Show autoblock duration in the form at Special:Block
When using the autoblock IP feature in Special:Block, it is not clear
what the autoblock duratiion is (usually, it is 24 hours).

Add the formatted duration to the message (ipbenableautoblock) used for
the checkbox label.

Bug: T288438
Change-Id: I20f50bf44ad84720c13381980b18f58e36f167db
2021-09-17 15:43:27 +01:00
jenkins-bot
76ba780e41 Merge "WikiExporter: inject services" 2021-09-16 17:04:04 +00:00
jenkins-bot
ed13eb01c4 Merge "Update Special:Block UI" 2021-09-16 16:36:53 +00:00
jenkins-bot
6e99ddcef6 Merge "Mark hidden tags on Special:Tags and show in RCFilters" 2021-09-10 08:54:20 +00:00
Bartosz Dziewoński
0d3fa1d14c Mark hidden tags on Special:Tags and show in RCFilters
Bug: T281741
Change-Id: I8122fdc709427adc4681b463a52530117fabaef3
2021-09-09 19:38:46 +02:00
DannyS712
7cca5dea0b TablePager: fix param documentation for formatValue()
Can receive null value if the field isn't in the database result.

Change-Id: Id995a384dc58f5d8216a7309490b98558004d071
2021-09-09 08:44:27 +02:00
Reedy
4dae3b1a06 Rename four config variables to avoid 'blacklist' term
As part of our wider work on modernising and making more welcoming the
language we use within and around MediaWiki, now is a good time for us
to rename these configuration variables:

 - $wgFileBlacklist is now $wgProhibitedFileExtensions
 - $wgMimeTypeBlacklist is now $wgMimeTypeExclusions
 - $wgEnableUserEmailBlacklist is now $wgEnableUserEmailMuteList
 - $wgShortPagesNamespaceBlacklist is now $wgShortPagesNamespaceExclusions

Bug: T277987
Depends-On: I91e065c58fda144a722a41cf532e717f962d7a64
Change-Id: I558a8b20d67d48edccce0d065aec2d22992e9dda
2021-09-08 23:32:29 +01:00
STran
d1567ad106 Update Special:Block UI
Adjust UI to be more explicit about which options apply
to sitewide vs partial blocks

Bug: T280719
Change-Id: I38943124c7f3c1aeb4ea8c9b92971a8f59801205
2021-09-08 01:43:34 -07:00
Umherirrender
44fd53fee3 Using @return never documentation on always-throw-function
This helps phan to detect unreachable code and also impossible types
after the functions.
It helps phan to avoid false positives for array keys
when the keys are checked before

Bug: T240141
Change-Id: I895f70e82b3053a46cd44135b15437e6f82a07b2
2021-09-07 17:29:03 +02:00
Umherirrender
07b499fbcf build: Update mediawiki/mediawiki-phan-config to 0.11.0
Addition and remove of suppression needs to be done with the version
update.

Change-Id: I3288b3cefa744b507eadebb67b8ab08c86517c1c
2021-09-07 17:19:05 +02:00
Alexander Vorwerk
2fbf13812a WikiExporter: inject services
This patch injects services into WikiExporter. It also adds a
WikiExporterFactory service for creating WikiExporter instances.

Change-Id: Ib1547defea54c309865c116bc83d617c21568843
2021-09-06 10:03:37 +00:00
jenkins-bot
1e76c7bfb0 Merge "Remove unneeded variable assignment" 2021-09-04 23:48:21 +00:00