Commit graph

884 commits

Author SHA1 Message Date
James D. Forrester
3f717984c1 Drop AuthPlugin and related code, deprecated in 1.27
Bug: T215843
Depends-On: Ie49709faa6f67b0a31bd546823d29dbfea0a70eb
Depends-On: If8109dbfdeeb88a6265f4cd79d1ae81bff48d934
Depends-On: I36b195fa2d6c23a76631ebaf869c787e44427d60
Depends-On: Iaa171b085fde331eab7d85c7de74523e27fc625a
Change-Id: I330b30d6582034a233fed204c0680b1ce84eec6e
2019-03-05 08:23:14 +00:00
Umherirrender
7edafc29c6 Move specialpage redirects related classes to own files
Change-Id: Ibddbb0c4e40fff310b1720ec9c72f2683cc93f54
2019-03-03 17:59:24 +00:00
Umherirrender
8d52cf3d12 Move FauxResponse class to own file
Similar to FauxRequest

Change-Id: Ia9e4e7287ade605899d935db7c9f1f017e0bcb85
2019-03-02 18:55:13 +00:00
Amir Sarabadani
f8efd21621 Fix lowercase in namespace of LogCapturingSpi.php
Basically turning Mediawiki to MediaWiki as all other classes exist
in that namespace

Bug: T217128
Change-Id: I95039a1a54c9900a2f2414b5a6ccce5fb6e5e612
2019-02-26 13:17:09 +01:00
jenkins-bot
dd35e1a469 Merge "Print logs generated during unit test when test fails" 2019-02-22 08:01:16 +00:00
Max Semenik
292e13edc5 Add support for Argon2 password hashing
So far, everything we had was vulnerable to newest advances in
GPU cracking and timing side-channel attacks. Argon2 was designed
specifically to address these problems.

Unfortunately, PHP support is lagging, with some builds missing
Argon2id or even Argon2i.

Change-Id: Ifdf648f5d8a734a663e630286724a6d0a87c7510
2019-02-10 02:20:52 -08:00
Matěj Suchánek
93aeb14e08 Move migrateActors.php to includes
This way it can be subclassed in extensions, like AbuseFilter
(Ic755526d5f989c4a66b1d37527cda235f61cb437).

Bug: T188180
Change-Id: Idf320232011c72e39267b1f3c39848aea35d37fe
2019-02-09 11:42:38 +01:00
James D. Forrester
edba8aaf5a Drop SiteSQLStore, deprecated in 1.27, unused
Change-Id: I6743417c3aafbba59ac02350e0190fbf688a5a40
2019-02-08 17:43:33 -08:00
Roan Kattouw
1c7c9bdf1f Use packageFiles feature to replace special-purpose RL modules
For config vars, add a virtual package file called 'config.js', and use
require( './config.js' ) in the module. For most data modules, add a
virtual package file called 'data.js', use require( './data.js' ) in the
module. Where needed, add wrapper files that put the data in the
relevant global object and in module.exports.

LanguageDataModule is the only special-purpose module not being removed
in this commit, because it uses languageScripts, and those are not
compatible with packageFiles (yet).

Also merge mediawiki.ForeignStructuredUpload.config into
mediawiki.ForeignStructuredUpload, since that was the only thing that
used it.

Change-Id: I203d4e3ecdeeeb16729eba2dcf40d11a41d2e582
2019-02-09 00:10:48 +00:00
Erik Bernhardson
56ffbc2a4e Print logs generated during unit test when test fails
When a unit test fails it is possible, perhaps even likely in some
cases, that some code that was run logged useful information about
how that failure came to be.

Help people out, tell them what happened!

Change-Id: I30bbc31799a65024868678d052fec9aafacc1aff
2019-02-06 14:43:32 -08:00
Umherirrender
b0a75622d3 Move upload stash related exceptions to own files
Change-Id: I23e81af2f1bf73f5cd78a01bcc2fcebb4c4ea038
2019-02-06 22:22:01 +01:00
Umherirrender
fa29c3c09d Move exceptions JobQueueError to own file
Change-Id: Ibd67358cb7a14497dce8a3982ceba3b4300bdd65
2019-02-06 19:39:20 +01:00
Umherirrender
6ebe568c4e Remove deprecated class SquidUpdate
Change-Id: Iac53864296990befe7c573a29dd2f35aca52a79e
2019-02-05 20:35:05 +01:00
Umherirrender
1c851623b0 Move interface ICacheHelper to own class
Change-Id: I6f2b6507b0038f0988e4db5566ebddbe0d734a70
2019-02-05 20:04:12 +01:00
Umherirrender
1ca06c64af Move interface IJobSpecification to own file
Change-Id: Iabb10f8473b2ef0f4aea2aaca0dad39745028ece
2019-02-04 21:04:12 +01:00
Umherirrender
5d2e39401d Move interface ILocalizedException to own file
Change-Id: I66429a89633a74a22999775214aa23ae189b837e
2019-02-01 20:05:30 +01:00
Kunal Mehta
951690c02e Rename tests/phpunit/includes/media files to match class names
The classes were renamed in 9bf39163, this updates the test cases to
match. Also take care of XCF while we're at it too.

Change-Id: Iaaeee93e496af6cdd610df5bc75302ecfe273f64
2019-01-29 23:21:13 -08:00
Bill Pirkle
e8cb9f5f83 http: Support callback functions in GuzzleHttpRequest
Provide backward compatibility for callback functions in
GuzzleHttpRequest, which was missing in T202110, and restore
GuzzleHttpRequest as the default provided by HttpRequestFactory.

Bug: T212175
Depends-On: I4b45e79d35252d13f714f3271b87301ca515121a
Change-Id: I60d1a034b44874f6d24a04058db264eeb565f5e1
2019-01-24 22:05:10 +00:00
jenkins-bot
c1436805cd Merge "Introduce multiselect widgets for namespaces" 2019-01-23 17:02:41 +00:00
jenkins-bot
f7ead5d3ca Merge "Better detection for old MS Office files" 2019-01-23 01:01:43 +00:00
Tim Starling
f12db38048 Better detection for old MS Office files
* Introduce MSCompoundFileReader, which reads the CFB directory and
  detects the file type from well-known names in the root directory
* Do not detect a ZIP file if the EOCDR is not at the end. Other
  containers, especially CFB files, may contain ZIP files embedded
  within them in the last 64KB, but this is not a security concern
  unless the EOCDR is exactly at the end of the file.

Bug: T40432
Change-Id: Id5b1a258ccf3c3c8951e32f6b7a5b1bafe941082
2019-01-23 09:23:17 +11:00
Thalia
ccbe9f3590 Introduce multiselect widgets for namespaces
Bug: T204986
Change-Id: Ie3916e2322d8b1a7effe9ba4604b596b568004e6
2019-01-22 12:48:42 +00:00
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