Commit graph

862 commits

Author SHA1 Message Date
SamanthaNguyen
870831d40c htmlform: Move HTMLSelectLanguageField into includes/htmlform/fields
This was originally directly under includes/htmlform. This is
a specific type of field, so it should go here instead.

Follows-up d0c31ac988.

Change-Id: Iac196068ce2cbca063948bc78d21913482717d9a
2019-01-22 04:56:44 +00:00
Lucas Werkmeister
7585985a46 Fully extract services framework as a library
This code doesn’t use any MediaWiki-specific code, so rename
MediaWiki\Services to Wikimedia\Services and move it below libs/. (Of
course, this does not apply to the MediaWikiServices subclass.)

Class aliases are added to retain backwards compatibity for now.

Bug: T211608
Change-Id: Ic14ea28ef21c359695b309d4293dbaaf5deedc09
2019-01-16 17:31:05 +01:00
jenkins-bot
1c29f24dd5 Merge "Add special page class for disabling special pages" 2019-01-12 19:01:45 +00:00
Gergő Tisza
608879edbf Add special page class for disabling special pages
Similar to the ApiDisabled class, but for special pages.

Change-Id: Ib56860bc3f8a14fd332b775b1e7f50953641ee82
2019-01-12 18:46:36 +00:00
Sethakill
d0c31ac988 Convert Special:AllMessages to use OOUI
Moved form from pager and
added new HTMLSelectLanguageField.

Bug: T117749
Bug: T134425
Change-Id: I46dc6cc8f7ddf8552a726202df136cbbff66588c
2019-01-02 15:18:19 -08:00
jenkins-bot
f186496005 Merge "Add ProfilerExcimer" 2018-12-16 23:00:16 +00:00
Thalia
2d2bb3720a Introduce TagMultiselectWidget.php
TitlesMultiselectWidget and UsersMultiselectWidget share
a lot of functionality, so implement a common base class.

This also adds some things to UsersMultiselectWidget:
* shows a pending element to users with JavaScript
* makes the input configurable

Change-Id: Ie6649b476c64e795254f457e3863fa7f14aa05ac
2018-12-14 15:18:11 +00:00
Bill Pirkle
efd8077aa2 Create GuzzleHttpRequest class as new default for HttpRequestFactory
Create a GuzzleHttpRequest class using the external Guzzle
(docs.guzzlephp.org) library. This will be the new default request type,
but CurlHttpRequest and PhpHttpRequest remain available and accessible
via Http::$httpEngine.

Bug: T202110
Change-Id: Ie720be2628d7baf427b002847f103fd86ee4cff3
Depends-On: I143a6410d111e75f01dbbfd43f300e2e60247451
2018-12-10 00:36:59 -08:00
jenkins-bot
c90f3220a3 Merge "monolog: add CeeFormatter" 2018-12-07 21:24:17 +00:00
Filippo Giunchedi
667b17a319 monolog: add CeeFormatter
This formatter extends LogstashFormatter to prefix records with "cee token"
used for syslog and JSON structured logging. See also related task for more
context.

Bug: T211124
Change-Id: I3cdeb4c666f54039b5e8ecc67bd4937220333526
2018-12-07 09:04:54 +01:00
Tim Starling
6373e3d1d4 Add ProfilerExcimer
Add a Profiler subclass for the new excimer extension. Since it does not
provide function counts, it's a little bit awkward to return it in the
format required by getFunctionStats(), but getOutput() works quite well.

Fix totally broken ProfilerOutputDb, the first parameter to the
onTransactionCommitOrIdle callback is not a Database. It is in the
second parameter, but most callers do not use it.

Change-Id: Icb20f3a5b0b09ff2905f1711f3681c398aa026e2
Depends-On: I6a9ccf5a12ef998e029033adf08af95c42fb7f8e
2018-12-07 11:42:59 +11:00
Thalia
62b4cee23f TitlesMultiselectWidget: display pending element
Create a PendingTextInputWidget and use it in
TitlesMultiSelectWidget instead of the multiline
text area for users who have JavaScript.

Bug: T210080
Change-Id: I824fea6a3df580d342e6087ab901fec025f0e70b
2018-12-05 21:08:38 +00:00
Brad Jorsch
d65e96b763 Use new externallinks.el_index_60 field
This adds a method to LinkFilter to build the query conditions necessary
to properly use it, and adjusts code to use it.

This also takes the opportunity to clean up the calculation of el_index:
IPs are handled more sensibly and IDNs are canonicalized.

Also weird edge cases for invalid hosts like "http://.example.com" and
corresponding searches like "http://*..example.com" are now handled more
regularly instead of being treated as if the extra dot were omitted,
while explicit specification of the DNS root like "http://example.com./"
is canonicalized to the usual implicit specification.

Note that this patch will break link searches for links where the host
is an IP or IDN until refreshExternallinksIndex.php is run.

Bug: T59176
Bug: T130482
Change-Id: I84d224ef23de22dfe179009ec3a11fd0e4b5f56d
2018-11-12 22:33:18 +00:00
Piotr Miazga
4c73c8a676 Provide a script to reset the page_random column
Bug: T208909
Change-Id: I914ff44d1212c565e08ff17effbd682dfe7f70fb
2018-11-09 15:07:48 -07:00
jenkins-bot
00063e1eb1 Merge "resources: Extract ForeignResourceManager from manageForeignResources.php" 2018-11-06 20:36:14 +00:00
James D. Forrester
36ec0c6984 Drop six authentication-related hooks, deprecated in 1.27
AbortAutoAccount, AbortNewAccount, AbortLogin, LoginUserMigrated,
UserCreateForm, and UserLoginForm are all unused in Wikimedia
production and rare in other extensions.

This also scraps the FakeAuthTemplate and LoginForm classes and
the occasional remainig references thereto.

Bug: T193755
Change-Id: I24d6fa963f402d4311fa00fc11536a37ee3bd31e
2018-10-29 15:02:06 -07:00
jenkins-bot
dea8f5344b Merge "Create JobQueueEnqueueUpdate class to call JobQueueGroup::pushLazyJobs()" 2018-10-28 23:10:53 +00:00
Aaron Schulz
6030e9cf2c Create JobQueueEnqueueUpdate class to call JobQueueGroup::pushLazyJobs()
This assures that MergeableUpdate tasks that lazy push job will actually
have those jobs run instead of being added after the lone callback update
to call JobQueueGroup::pushLazyJobs() already ran.

This also makes it more obvious that push will happen, since a mergeable
update is added each time lazyPush() is called and a job is buffered,
rather than rely on some magic callback enqueued into DeferredUpdates at
just the right point in multiple entry points.

Bug: T207809
Change-Id: I13382ef4a17a9ba0fd3f9964b8c62f564e47e42d
2018-10-28 22:19:06 +00:00
jenkins-bot
cb4d4c4d8f Merge "Move user_editcount updates to a mergeable deferred update" 2018-10-26 20:32:24 +00:00
Aaron Schulz
390fce6db1 Move user_editcount updates to a mergeable deferred update
This should reduce excess contention and lock timeouts.
Previously, it used a pre-commit hook which ran just before the
end of the DB transaction round.

Also removed unused User::incEditCountImmediate() method.

Bug: T202715
Depends-on: I6d239a5ea286afb10d9e317b2ee1436de60f7e4f
Depends-on: I0ad3d17107efc7b0e59f1dd54d5733cd1572a2b7
Change-Id: I0d6d7ddd91bbb21995142808248d162e05696d47
2018-10-25 15:32:18 -07:00
jenkins-bot
954b695a85 Merge "Remove old "bulletin board style toolbar" from core" 2018-10-24 05:30:14 +00:00
jenkins-bot
295ed872b1 Merge "TitlesMultiselectWidget: Add a widget that allows selection of multiple titles" 2018-10-24 01:35:54 +00:00
Moriel Schottlender
07a5c71646 TitlesMultiselectWidget: Add a widget that allows selection of multiple titles
Add the widget in both PHP and JS for OOUI, and into HTMLForm
definitions.

In JS, the widget uses the engine from mw.widgets.TitleWidget
with the async support from OO.ui.mixin.RequestManager.

The PHP version provides a textarea, like UsersMultiselectWidget.php
which is then infused if JS is available.

Also, add highlightSearchQuery option for TitleWidget to allow for
not highlighting the partial search query the user typed in, if the
UI requires it. This option (highlighting partial result) is already
optional in the TitleOptionWidget, so this config exposes that
optionality in the TitleWidget widget for its menu children.

Notes:

HTMLTitlesMultiselectField is a duplication of HTMLUsersMultiselectField
except for:
- The configuration variable changed to 'titles' (from 'users')
- OOUI modules were adjusted for the TitlesMultiselectWidget
- The PHP version instantiates a MediaWiki\Widget\TitlesMultiselectWidget

TitlesMultiselectWidget is a duplication of UsersMultiselectWidget
except for:
- $usersArray was renamed to $titlesArray
- getJavascriptClassName returns the correct js class for
  mw.widgets.TitlesMultiselectWidget for infusion.

Bug: T197109
Depends-On: I675316dddf272fd0d6172ecad3882160752bf780
Change-Id: Ie96947a35f70b76731e16ae5b85de815dfa4a8ce
2018-10-24 00:46:48 +00:00
Reedy
1ee582b2a8 Remove UtfNormal class
Change-Id: I1cab16d95ed888b482d23f73577c988700e0bca4
2018-10-22 12:17:00 -07:00
jenkins-bot
837b96248d Merge "Revert "Introduce Special:RedirectExternal"" 2018-10-18 17:05:10 +00:00
Kosta Harlan
7e81d6f49e Revert "Introduce Special:RedirectExternal"
This reverts commit b83cf88837.

Reason for revert: Security concerns, needs some more nuance.

Change-Id: I5823c3da77accca9839f9632611315223e05351b
2018-10-18 16:18:20 +00:00
jenkins-bot
c75059dacb Merge "Introduce Special:RedirectExternal" 2018-10-17 22:12:52 +00:00
Kosta Harlan
b83cf88837 Introduce Special:RedirectExternal
Special:RedirectExternal is an unlisted special page that accepts a URL as
the first argument, and redirects the user to that page.
Example: Special:RedirectExternal/https://mediawiki.org

At the moment, this is intended to be used by the GrowthExperiments project in
order to track outbound visits to certain external links. But it could be
extended in the future to provide parameters for showing a message to the user
before redirecting, or explicitly requiring a user to click on the link, which
could help improve security when users follow on-wiki links to off-wiki sites.

Bug: T207115
Change-Id: I822af14a84569aab22249e2f16a662a60e60f76a
2018-10-17 14:52:09 -07:00
James D. Forrester
cfa70ea6d0 Remove old "bulletin board style toolbar" from core
With this change, MediaWiki will no longer have a 'JavaScript-powered'
wikitext toolbar, and instead sysadmins will be required to choose one
(or more) of the several extensions available for this purpose if they
need the functionality. For over half a decade MediaWiki's tarball has
included the 2010-era replacement for this feature, WikiEditor. We are
now working on replacing even that, with the 2013-era visual editor, a
mode of which is the forthcoming 2017-era wikitext editor, and several
more specialised editors like CodeEditor.

Beyond this, the core editor toolbar is ancient, un-loved, and is used
only exceptionally rarely, mostly by accident. It is unhelpful to give
implicitly this as the primary editor for MediaWiki just because we've
not removed it from core when it is not a very good experience for any
kind of user, and has not received the attention that users deserve to
be worth retaining in core.

The old core preference, which was intended to govern whether this old
toolbar should be shown, has since mutated into whether the to run the
EditPageBeforeEditToolbar hook. The hook is used by several extensions
to provide toolbars in lieu of the core one. This preference has been,
in practice, a very confusing preference for MediaWiki users, who have
to interact with quite similar preferences to toggle their real editor
which sit next to this one on the preferences page. Consequently, this
preference is also removed.

The code could be made into an extension for those (very few) users of
MediaWiki who might want to keep on using it. However, the author will
offer their services but not their encouragement in said undertaking.

Bug: T30856
Bug: T32795
Change-Id: I2b05f0ca25873ad8e0b33a5e4938bef52c4e9347
2018-10-16 20:08:32 -07:00
Brad Jorsch
6ff65e57bb API: Remove long-deprecated methods (and one class)
* ApiBase::profileIn() (deprecated in 1.25)
* ApiBase::profileOut() (deprecated in 1.25)
* ApiBase::safeProfileOut() (deprecated in 1.25)
* ApiBase::profileDBIn() (deprecated in 1.25)
* ApiBase::profileDBOut() (deprecated in 1.25)
* ApiBase::dieUsage() (deprecated in 1.29)
* ApiBase::dieUsageMsg() (deprecated in 1.29)
* ApiBase::dieUsageMsgOrDebug() (deprecated in 1.29)
* ApiBase::getErrorFromStatus() (deprecated in 1.29)
* ApiBase::parseMsg() (deprecated in 1.29)
* ApiBase::setWarning() (deprecated in 1.29)
* ApiPageSet::getInvalidTitles() (deprecated in 1.26)
* ApiQueryLogEvents::addLogParams() (deprecated in 1.25)
* ApiUsageException::getCodeString() (deprecated in 1.29)
* ApiUsageException::getMessageArray() (deprecated in 1.29)
* UsageException (deprecated in 1.29)

Change-Id: Iabb2589a29cc3b46624d31358f3a6bf7b3ccbd57
2018-10-15 16:37:04 -04:00
Timo Tijhof
54bd639467 resources: Extract ForeignResourceManager from manageForeignResources.php
This should make it easier to test, and would also allow other repositories
to create an instance of it in a maintenance script of their own.

Change-Id: I6a28e184f80eb38b5c25a0be5a9041f0c587c852
2018-10-15 03:16:18 +01:00
jenkins-bot
cf6fb41666 Merge "Re-namespace RevisionStore and RevisionRecord classes" 2018-10-10 05:16:45 +00:00
jenkins-bot
95bb2a6f0b Merge "Use job queue for deletion of pages with many revisions" 2018-10-10 04:55:53 +00:00
Brad Jorsch
dff469a408 Re-namespace RevisionStore and RevisionRecord classes
During development a lot of classes were placed in MediaWiki\Storage\.
The precedent set would mean that every class relating to something
stored in a database table, plus all related value classes and such,
would go into that namespace.

Let's put them into MediaWiki\Revision\ instead. Then future classes
related to the 'page' table can go into MediaWiki\Page\, future classes
related to the 'user' table can go into MediaWiki\User\, and so on.

Note I didn't move DerivedPageDataUpdater, PageUpdateException,
PageUpdater, or RevisionSlotsUpdate in this patch. If these are kept
long-term, they probably belong in MediaWiki\Page\ or MediaWiki\Edit\
instead.

Bug: T204158
Change-Id: I16bea8927566a3c73c07e4f4afb3537e05aa04a5
2018-10-09 10:22:48 -04:00
Aaron Schulz
59242afaa7 messagecache: use MergeableUpdate for the deferred replace() update
This combines the load loop for multiple messages for a language code.

Bug: T203925
Bug: T193271
Change-Id: Ie5e1e83d6740344b7ca641c99fb3bd4ad5718492
2018-10-05 20:14:41 +00:00
Bill Pirkle
ca9f1dabf3 Use job queue for deletion of pages with many revisions
Pages with many revisions experience transaction size exceptions,
due to archiving revisions.  Use the job queue to split the work
into batches and avoid exceptions.

Bug: T198176
Change-Id: Ie800fb5a46be837ac91b24b9402ee90b0355d6cd
2018-10-03 19:16:14 -05:00
Brad Jorsch
7a422138a7 Migrate image descriptions from image_comment_temp
image_comment_temp was always intended to be temporary, until an
expensive schema change on Wikimedia Commons's image table could be
done. Now that that has been done, stop writing image_comment_temp and
add a migration script to copy existing data into img_description_id.

Ic8efeddc will remove the reads from image_comment_temp and drop the
image_comment_temp table.

Bug: T188132
Change-Id: Iab5f521577a415b2dc213b517ee8a0dca4fdd0aa
2018-10-02 10:30:00 -04:00
Reedy
ed6d53fd38 Add a maintenance script to remove all users from a User Group
Bug: T185989
Change-Id: Ie5cc95b350230bc730c1f1d9f06fc3e95c5f6bd0
2018-09-25 00:57:16 +00:00
jenkins-bot
cf0f32f778 Merge "Provide a way to restore an old revision with multiple slots." 2018-09-24 19:36:32 +00:00
daniel
9da12daf46 Provide a way to restore an old revision with multiple slots.
Bug: T204732
Change-Id: I0ea2711e68c78465a5e5cfaa0181ad5ce983d35a
2018-09-24 19:46:30 +02:00
Reedy
6aaaa070f3 Remove MimeMagic
Deprecated since 1.28

Change-Id: I793deb8669e353525464ccd840801e5015c545c8
2018-09-23 20:13:29 +00:00
Reedy
71badb429e Remove global namespaced LBFactory
Change-Id: Ia87aa5c9426af83627a1bbc9bd914546c89c1e47
2018-09-21 15:42:42 +00:00
jenkins-bot
b7625d63a6 Merge "Introduce ContentHandler::getSecondaryDataUpdates." 2018-09-17 14:06:19 +00:00
daniel
7960d5385f Introduce ContentHandler::getSecondaryDataUpdates.
This adds getSecondaryDataUpdates and getDeletionUpdates
to ContentHandler, and updates WikiPage and DerivedPageDataUpdates
to handle DataUpdates from all slots.

Bug: T194038
Bug: T194037
Change-Id: I75c96318f58a5cdda48484f7040ae41e6f42392a
2018-09-14 16:18:18 +02:00
Pikne
9c46871d60 Remove xx-uca-et collation workaround
Remove workaround introduced in I3e8031b9. No longer needed.

Bug: T202977
Change-Id: I39921ef83cddc33535b99bd9c0b75f8afb52ea9a
2018-09-11 13:33:24 +00:00
Kunal Mehta
e5ded68cf0 Use PSR-4 autoloader for includes/auth/
Change-Id: I63dec06f231a57093086f129b3c1d0ebe1389bab
2018-09-01 20:55:53 +00:00
jenkins-bot
0746755fa9 Merge "Split AuthManagerAuthPluginUser into a separate file" 2018-09-01 20:40:23 +00:00
daniel
e9f71517f7 [MCR] Introduce RevisionRenderer
RevisionRenderer is the MCR replacement for Content::getParserOutput,
as outlined in <https://www.mediawiki.org/wiki/User:Daniel_Kinzler_(WMDE)/MCR-PageUpdater>.

Note: This change also introduces quite a bit of code for
merging ParserOutput objects.

Bug: T194048
Change-Id: I871978bf79f67c9e7954fb3fc8528d6e365f2cc1
2018-08-30 19:15:12 +02:00
Kunal Mehta
d9deecf432 Split AuthManagerAuthPluginUser into a separate file
Change-Id: I22d2bf9514caf717a5d949bed425de1376670d3e
2018-08-28 15:22:49 -07:00
jenkins-bot
d9fb5f0346 Merge "Replace "Bug37714" by "T39714"" 2018-08-27 20:31:34 +00:00