lhc/web/wiklou.git
4 years agoInstaller: Update link to PHP intl away from old PECL package
Karsten Hoffmeyer [Tue, 11 Jun 2019 19:24:16 +0000 (21:24 +0200)]
Installer: Update link to PHP intl away from old PECL package

PHP 5.5 was the last version supported by PECL intl package. Now the
PHP intl extension is used instead.

Bug: T225558
Change-Id: I68cb7a549c899e69da9a8cfea5a69b9acb41e8ae

4 years agoAllow loading styles for arbitrary OOUI icon packs
Bartosz Dziewoński [Mon, 12 Feb 2018 19:41:44 +0000 (20:41 +0100)]
Allow loading styles for arbitrary OOUI icon packs

You can now create ResourceLoader modules for arbitrary sets of OOUI
icons. This is an alternative to I8af783666a2b23a938af93c1b56fee619219eaf5.

Update dependencies of OOUI's modules to use custom icon packs instead
of default icon packs.

Bug: T160690
Change-Id: Icf9560da79c91e56c7a3f4c0de01dd057f5aa00d

4 years agoMerge "resources: Remove unused jquery.effects.* modules"
jenkins-bot [Tue, 11 Jun 2019 17:42:57 +0000 (17:42 +0000)]
Merge "resources: Remove unused jquery.effects.* modules"

4 years agoMerge "Normalize dir path in AutoLoaderStructureTest"
jenkins-bot [Tue, 11 Jun 2019 15:58:09 +0000 (15:58 +0000)]
Merge "Normalize dir path in AutoLoaderStructureTest"

4 years agoMerge "Move cookie-blocking methods to BlockManager"
jenkins-bot [Tue, 11 Jun 2019 15:16:00 +0000 (15:16 +0000)]
Merge "Move cookie-blocking methods to BlockManager"

4 years agoresources: Remove unused jquery.effects.* modules
Derick Alangi [Fri, 19 Apr 2019 18:25:14 +0000 (19:25 +0100)]
resources: Remove unused jquery.effects.* modules

* jquery.ui.effect-bounce [removed]
* jquery.ui.effect-explode [removed]
* jquery.ui.effect-fold [removed]
* jquery.ui.effect-pulsate [removed]
* jquery.ui.effect-slide [removed]
* jquery.ui.effect-transfer [removed]

Bug: T219604
Change-Id: I9a9acd8ed3d4a3b6c50f57fbb11e6038713a2a09

4 years agoMerge "Have ServiceContainer implement PSR-11"
jenkins-bot [Tue, 11 Jun 2019 14:39:55 +0000 (14:39 +0000)]
Merge "Have ServiceContainer implement PSR-11"

4 years agoMerge "Replace some uses of deprecated wfFindFile() and wfLocalFile()"
jenkins-bot [Tue, 11 Jun 2019 14:23:24 +0000 (14:23 +0000)]
Merge "Replace some uses of deprecated wfFindFile() and wfLocalFile()"

4 years agoMerge "Fix return type of File::restore()"
jenkins-bot [Tue, 11 Jun 2019 14:20:09 +0000 (14:20 +0000)]
Merge "Fix return type of File::restore()"

4 years agoMove cookie-blocking methods to BlockManager
Thalia [Thu, 6 Jun 2019 18:00:20 +0000 (14:00 -0400)]
Move cookie-blocking methods to BlockManager

Move the cookie blocking logic into one place. Specifically, move
these methods to the BlockManager:
* User::trackBlockWithCookie
* DatabaseBlock::setCookie
* DatabaseBlock::clearCookie
* DatabaseBlock::getCookieValue
* DatabaseBlock::getIdFromCookieValue
* AbstractBlock::shouldTrackWithCookie

After this, BlockManager::trackBlockWithCookie should be called to
track a block, and BlockManager::clearBlockCookie should be called
to unset the cookie. The other methods in the above list are
helper methods that are made private or marked internal.

Also update places in core that call User::trackBlockWithCookie to
BlockManager::trackBlockWithCookie

Bug: T225141
Change-Id: I818962c6932c01c841a549a101637e00a7593e48

4 years agoMerge "Set cache types to APC/APCu/WinCache in DevelopmentSettings.php"
jenkins-bot [Tue, 11 Jun 2019 13:53:05 +0000 (13:53 +0000)]
Merge "Set cache types to APC/APCu/WinCache in DevelopmentSettings.php"

4 years agoReplace some uses of deprecated wfFindFile() and wfLocalFile()
Derick Alangi [Tue, 14 May 2019 17:00:34 +0000 (18:00 +0100)]
Replace some uses of deprecated wfFindFile() and wfLocalFile()

These global functions were deprecated in 1.34 and services made
available to replace them. See services below;

* wfFindFile() - MediaWikiServices::getInstance()->getRepoGroup()->findFile()
* wfLocalFind() - MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()->newFile()

NOTES:

* wfFindFile() and wfLocalFind() usages in tests have been ignored
  in this change per @Timo's comments about state of objects.

* includes/upload/UploadBase.php also maintained for now as it causes
  some failures I don't fully understand, will investigate and handle
  it in a follow up patch.

* Also, includes/MovePage.php

Change-Id: I9437494de003f40fbe591321da7b42d16bb732d6

4 years agoFix return type of File::restore()
Lucas Werkmeister [Tue, 11 Jun 2019 12:35:23 +0000 (14:35 +0200)]
Fix return type of File::restore()

The only real implementation, LocalFile::restore(), has not returned an
int|bool since commit ca76169bbe, almost twelve years ago. (MediaWiki
code search [1] finds no other implementations.)

This discrepancy became more visible when we moved from wfLocalFile() to
FileRepo::findFile(), because wfLocalFile() (incorrectly, as it just
calls FileRepo::findFile()) is declared to return a LocalFile, rather
than any File as FileRepo::findFile() does, so the incorrect return type
on File::returnType() was not seen by wfLocalFile() users.

[1]: https://codesearch.wmflabs.org/search/?q=function%20restore\(&files=\.php%24

Change-Id: Idaf73074eaddc5be1782ae484d75a0f0c129b980

4 years agoMerge "Remove return value from SpecialUploadStash::execute"
jenkins-bot [Tue, 11 Jun 2019 11:54:07 +0000 (11:54 +0000)]
Merge "Remove return value from SpecialUploadStash::execute"

4 years agoMerge "api: Temporarily disable ApiQueryLanguageinfoTest"
jenkins-bot [Tue, 11 Jun 2019 11:53:59 +0000 (11:53 +0000)]
Merge "api: Temporarily disable ApiQueryLanguageinfoTest"

4 years agoSet cache types to APC/APCu/WinCache in DevelopmentSettings.php
Amir Sarabadani [Tue, 11 Jun 2019 11:21:54 +0000 (13:21 +0200)]
Set cache types to APC/APCu/WinCache in DevelopmentSettings.php

Bug: T225496
Change-Id: I14dd3fea9795a501e29383a3cae2b3e9a0077e69

4 years agoMerge "Allow MediaWikiTestCase::editPage to use given User"
jenkins-bot [Tue, 11 Jun 2019 00:28:34 +0000 (00:28 +0000)]
Merge "Allow MediaWikiTestCase::editPage to use given User"

4 years agoMerge "build: Upgrade stylelint-config-wikimedia from 0.5.0 to 0.6.0 and make pass"
jenkins-bot [Mon, 10 Jun 2019 23:57:23 +0000 (23:57 +0000)]
Merge "build: Upgrade stylelint-config-wikimedia from 0.5.0 to 0.6.0 and make pass"

4 years agoMerge "jquery.suggestions: Combine two isRTL checks"
jenkins-bot [Mon, 10 Jun 2019 23:50:22 +0000 (23:50 +0000)]
Merge "jquery.suggestions: Combine two isRTL checks"

4 years agoMerge "resourceloader: Add explicit tests for isValidModuleName()"
jenkins-bot [Mon, 10 Jun 2019 23:44:07 +0000 (23:44 +0000)]
Merge "resourceloader: Add explicit tests for isValidModuleName()"

4 years agoMerge "resourceloader: Warn on ResourceLoader::construct without Config"
jenkins-bot [Mon, 10 Jun 2019 23:43:21 +0000 (23:43 +0000)]
Merge "resourceloader: Warn on ResourceLoader::construct without Config"

4 years agobuild: Upgrade stylelint-config-wikimedia from 0.5.0 to 0.6.0 and make pass
James D. Forrester [Mon, 3 Jun 2019 21:04:54 +0000 (14:04 -0700)]
build: Upgrade stylelint-config-wikimedia from 0.5.0 to 0.6.0 and make pass

Change-Id: I062bed7889cdfcc48eab9594200fc1d4767dda8c

4 years agoMerge "build: Commit package-lock.json"
jenkins-bot [Mon, 10 Jun 2019 21:40:46 +0000 (21:40 +0000)]
Merge "build: Commit package-lock.json"

4 years agoMerge "mediawiki.Title: Remove dead code and streamline newFromUserInput()"
jenkins-bot [Mon, 10 Jun 2019 21:28:20 +0000 (21:28 +0000)]
Merge "mediawiki.Title: Remove dead code and streamline newFromUserInput()"

4 years agobuild: Commit package-lock.json
James D. Forrester [Mon, 10 Jun 2019 21:24:21 +0000 (14:24 -0700)]
build: Commit package-lock.json

First step towards making our developers less vulnerable to
credential-stealing attacks through the npm registry.

Per T211784 and 5a300c77c302, mediawiki-core now uses Node 10
for at least one of the jobs that runs 'npm install'.

Change-Id: Ia4c59d3fc18ce0e13a4e5c3a00804e54dcb015a3

4 years agoMerge "foreign-resources.yaml: Add jquery.chosen"
jenkins-bot [Mon, 10 Jun 2019 21:23:33 +0000 (21:23 +0000)]
Merge "foreign-resources.yaml: Add jquery.chosen"

4 years agoMerge "watcheditem: Do not create the same TitleValue object twice"
jenkins-bot [Mon, 10 Jun 2019 20:27:02 +0000 (20:27 +0000)]
Merge "watcheditem: Do not create the same TitleValue object twice"

4 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Mon, 10 Jun 2019 20:19:28 +0000 (20:19 +0000)]
Merge "Localisation updates from https://translatewiki.net."

4 years agoMerge "Fix documentation of Maintenance::updateSearchIndex"
jenkins-bot [Mon, 10 Jun 2019 20:18:53 +0000 (20:18 +0000)]
Merge "Fix documentation of Maintenance::updateSearchIndex"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 10 Jun 2019 20:18:44 +0000 (22:18 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I695bfdbedde246b905e0fb7573a4070ffb0e4f78

4 years agowatcheditem: Do not create the same TitleValue object twice
Umherirrender [Fri, 7 Jun 2019 14:28:31 +0000 (16:28 +0200)]
watcheditem: Do not create the same TitleValue object twice

Minor optimization in getWatchedItemsForUser(). Follows-up 7c12727fff0.

Change-Id: I29f40f2c09c334eea33c7aaf351e1f1a93de9c13

4 years agoMerge "Remove RELEASE-NOTES-1.33"
jenkins-bot [Mon, 10 Jun 2019 19:59:10 +0000 (19:59 +0000)]
Merge "Remove RELEASE-NOTES-1.33"

4 years agoAllow MediaWikiTestCase::editPage to use given User
MusikAnimal [Mon, 3 Jun 2019 19:52:46 +0000 (15:52 -0400)]
Allow MediaWikiTestCase::editPage to use given User

Sometimes you need to edit pages with a non-sysop.

This is a follow-up to I9e48f7c00efbce8c2de3f5db3a74462d47ae8f64

Change-Id: I5a101638f57709c343a2e42ca0ae11527bee8cce

4 years agoHave ServiceContainer implement PSR-11
Kunal Mehta [Thu, 6 Jun 2019 01:12:45 +0000 (21:12 -0400)]
Have ServiceContainer implement PSR-11

Bug: T222410
Change-Id: Ifab2602972ba385a975a0d8279605d2c4802ca9f
Depends-On: I5629e287208b2f038753d88d328989ebdc934c0f

4 years agoresourceloader: Warn on ResourceLoader::construct without Config
Timo Tijhof [Mon, 10 Jun 2019 15:00:16 +0000 (16:00 +0100)]
resourceloader: Warn on ResourceLoader::construct without Config

The only remaining use of 'new ResourceLoader' is in tests, which have
been migrated in this commit to either passing the real config explicitly
(for integration tests), or by passing a HashConfig from a new
'getMinimalConfig' method which has only the keys required for the tests
to pass (e.g. avoid any ConfigExeption for unknown keys).

Also clean up some related code quality issues:

* Migrate wfScript() to $conf->get() so that the local Config is used,
  instead of implicitly using global variables. This isn't deprecated for
  MediaWiki generally, but done here to prepare ResourceLoader for becoming
  a standalone library.

* Remove mocking of 'CacheEpoch' config, this is no longer used anywhere
  in ResourceLoader.

* Change EmptyResourceLoader to use the minimal config by default and
  remove code duplication by calling the parent.

  Update the small number of uses that are integration tests, to explicitly
  pass in the live config as needed. And for the one case that tests the
  'startup' module, it no longer needs to register it manually given this
  is part of ResourceLoader::__construct() by default.

Bug: T32956
Change-Id: I127346fd530fa66f205156e545758b1c29d0fac0

4 years agoselenium: Skip flaky Rollback test
Adam Wight [Thu, 6 Jun 2019 10:55:32 +0000 (12:55 +0200)]
selenium: Skip flaky Rollback test

Sometimes the element doesn't appear.  This is breaking during gate-and-submit,
so skipping until it can be fixed properly.

Bug: T219440
Change-Id: I7286eb5499e34146acf5da3180b665436569a18c

4 years agoapi: Temporarily disable ApiQueryLanguageinfoTest
Timo Tijhof [Mon, 10 Jun 2019 15:13:19 +0000 (16:13 +0100)]
api: Temporarily disable ApiQueryLanguageinfoTest

Bug: T225244
Change-Id: I0f778f1b4f8bd53bd8d52540afbe6927a14b583a

4 years agoMerge "resourceloader: Add coverage for DerivativeRLContext::getDirection inheritance"
jenkins-bot [Mon, 10 Jun 2019 15:00:12 +0000 (15:00 +0000)]
Merge "resourceloader: Add coverage for DerivativeRLContext::getDirection inheritance"

4 years agoresourceloader: Add coverage for DerivativeRLContext::getDirection inheritance
Timo Tijhof [Mon, 10 Jun 2019 14:25:24 +0000 (15:25 +0100)]
resourceloader: Add coverage for DerivativeRLContext::getDirection inheritance

This was the only case not covered, possibly due to a copy-paste
mistake when writing the test.

Change-Id: I1d01a1191da15162f301cea4082c0f1f481cece7

4 years agoUse AtEase::quietCall() instead of Wikimedia\quietCall()
Derick Alangi [Sun, 26 May 2019 21:46:15 +0000 (22:46 +0100)]
Use AtEase::quietCall() instead of Wikimedia\quietCall()

Wikimedia\quietCall() is deprecated and AtEase is here for use.
I would have loved to do restoreWarnings() and suppressWarnings()
in this same patch set but will continue the work for a later patch.

Bug: T182273
Change-Id: I43e3a5f378c99b5c40883b35ba133cbd126fc433

4 years agojquery.suggestions: Combine two isRTL checks
Fomafix [Wed, 5 Jun 2019 20:08:48 +0000 (22:08 +0200)]
jquery.suggestions: Combine two isRTL checks

Also update comment about the direction.

Change-Id: Iba9e925eef3148c2964d51cf5e55402dc85d65dc

4 years agoMerge "tidy: Remove unused var and define $parts var to avoid undefined error"
jenkins-bot [Mon, 10 Jun 2019 13:48:27 +0000 (13:48 +0000)]
Merge "tidy: Remove unused var and define $parts var to avoid undefined error"

4 years agoMerge "jquery.suggestions: Use document.documentElement.clientWidth"
jenkins-bot [Mon, 10 Jun 2019 13:44:50 +0000 (13:44 +0000)]
Merge "jquery.suggestions: Use document.documentElement.clientWidth"

4 years agoMerge "jquery.suggestions: Use Object.create( null )"
jenkins-bot [Mon, 10 Jun 2019 13:41:20 +0000 (13:41 +0000)]
Merge "jquery.suggestions: Use Object.create( null )"

4 years agoMerge "jquery.suggestions: Remove public object $.suggestions"
jenkins-bot [Mon, 10 Jun 2019 13:40:09 +0000 (13:40 +0000)]
Merge "jquery.suggestions: Remove public object $.suggestions"

4 years agotidy: Remove unused var and define $parts var to avoid undefined error
Derick Alangi [Mon, 15 Apr 2019 16:07:31 +0000 (17:07 +0100)]
tidy: Remove unused var and define $parts var to avoid undefined error

Remove unused variable $parent in RemexCompatMunger::comment(). Also,
RemexMungerData::dump() could have a possibility that all checks fail
and $parts is not defined. There are two ways we can handle this, i.e.
either by doing `$parts = []`(setting $parts to an empty array) or by
safe guarding using an `isset()` check.

This patch uses the former so that $parts is defined and can be used
below in the code.

Change-Id: I4d601a6fe36a1dce0945686cb9880336d08338be

4 years agojquery.suggestions: Use Object.create( null )
Fomafix [Wed, 29 May 2019 22:56:46 +0000 (00:56 +0200)]
jquery.suggestions: Use Object.create( null )

Object.create( null ) creates an Object without predefined methods like
hasOwnProperty or constructor. This allow to use
key in object
instead of
Object.prototype.hasOwnProperty.call( object, key )
even if the key is 'constructor'.

Change-Id: I6ef9019309022a2a990deda685ba71ca61b86df3

4 years agoMerge "Drop SpecialPage::getTitle()"
jenkins-bot [Mon, 10 Jun 2019 05:49:20 +0000 (05:49 +0000)]
Merge "Drop SpecialPage::getTitle()"

4 years agoMerge "registration: Deprecate ParserTestFiles in extension.json"
jenkins-bot [Sun, 9 Jun 2019 20:13:23 +0000 (20:13 +0000)]
Merge "registration: Deprecate ParserTestFiles in extension.json"

4 years agoMerge "objectcache: Make BagOStuff::getCurrentTime() public"
jenkins-bot [Sun, 9 Jun 2019 17:33:40 +0000 (17:33 +0000)]
Merge "objectcache: Make BagOStuff::getCurrentTime() public"

4 years agoobjectcache: Make BagOStuff::getCurrentTime() public
Lucas Werkmeister [Sat, 8 Jun 2019 16:30:20 +0000 (18:30 +0200)]
objectcache: Make BagOStuff::getCurrentTime() public

If another cache wraps a BagOStuff, it may need to know about the
BagOStuff’s notion of the current time, which may be mocked and differ
from the real time.

Change-Id: I40f4085d4cf549314394d3140cccb1fe4e48690a

4 years agoMerge "build: Set opcache.enable_cli=1 for Travis CI builds"
jenkins-bot [Sun, 9 Jun 2019 16:54:59 +0000 (16:54 +0000)]
Merge "build: Set opcache.enable_cli=1 for Travis CI builds"

4 years agobuild: Set opcache.enable_cli=1 for Travis CI builds
RazeSoldier [Thu, 6 Jun 2019 08:57:51 +0000 (08:57 +0000)]
build: Set opcache.enable_cli=1 for Travis CI builds

Make test process faster. The code refer <https://docs.travis-ci.com/user/languages/php/>.

Bug: T225078
Change-Id: I8c4e87f75108cfbece17506aa630b205aabaab4b

4 years agoMerge "Adjust type hints in database related classes"
jenkins-bot [Sun, 9 Jun 2019 12:38:45 +0000 (12:38 +0000)]
Merge "Adjust type hints in database related classes"

4 years agoMerge "Use IResultWrapper in LinkBatch and BacklinkCache"
jenkins-bot [Sun, 9 Jun 2019 12:16:37 +0000 (12:16 +0000)]
Merge "Use IResultWrapper in LinkBatch and BacklinkCache"

4 years agoDrop SpecialPage::getTitle()
RazeSoldier [Sun, 9 Jun 2019 04:40:01 +0000 (04:40 +0000)]
Drop SpecialPage::getTitle()

Bug: T220656
Change-Id: I85935901a2101f8e5fa5211e54c26f31f9ff0aa1

4 years agoMerge "Print: Add padding on pre elements"
jenkins-bot [Sat, 8 Jun 2019 22:41:47 +0000 (22:41 +0000)]
Merge "Print: Add padding on pre elements"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 8 Jun 2019 20:09:28 +0000 (22:09 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ic243e28c02a6f791d269278c08a4deee105721c2

4 years agoPrint: Add padding on pre elements
Derk-Jan Hartman [Sat, 8 Jun 2019 20:04:10 +0000 (22:04 +0200)]
Print: Add padding on pre elements

This is inline with their non-print styling and avoids the border and
the glyph being so close that it affects readability.

Bug: T225188
Change-Id: I0dcf09742483e28535d1d48641ccfba359e9f377

4 years agoMerge "Deprecate logout token on GET"
jenkins-bot [Sat, 8 Jun 2019 19:02:23 +0000 (19:02 +0000)]
Merge "Deprecate logout token on GET"

4 years agoRemove RELEASE-NOTES-1.33
Reedy [Sat, 8 Jun 2019 12:22:12 +0000 (13:22 +0100)]
Remove RELEASE-NOTES-1.33

1.33.0-rc.0 is out, so probably not any more features being backported

It's already divered from the one in the REL1_33 branch, so has
little benefit staying in master

Change-Id: I21fa200e1c817099afa83062a357014b5481a18e

4 years agojquery.suggestions: Use document.documentElement.clientWidth
Fomafix [Wed, 5 Jun 2019 19:33:41 +0000 (21:33 +0200)]
jquery.suggestions: Use document.documentElement.clientWidth

On skins with a border and/or a margin on the <body> or the <html>
element the width of <body> is smaller than the width of the window.

Also use .appendTo( document.body ) instead of .appendTo( $( 'body' ) ).

Bug: T47668
Change-Id: I209eb6e3b95ba0fc6e7c5084242a90ca04c9e196

4 years agoMerge "Pass options as array to IDatabase::insert"
jenkins-bot [Sat, 8 Jun 2019 08:28:30 +0000 (08:28 +0000)]
Merge "Pass options as array to IDatabase::insert"

4 years agoMerge "Relax HTML sniffing checks on image upload"
jenkins-bot [Fri, 7 Jun 2019 21:53:31 +0000 (21:53 +0000)]
Merge "Relax HTML sniffing checks on image upload"

4 years agoRelax HTML sniffing checks on image upload
Brion Vibber [Thu, 6 Jun 2019 21:54:29 +0000 (14:54 -0700)]
Relax HTML sniffing checks on image upload

Allows uploaded files to include some HTML tag strings that were
previously forbidden in the first 1k or so of the file:
* <a href
* <img
* <pre
* <table
* <title

They are now allowed as long as the IE MIME type detection heuristic
would not change their types. This should reduce the number of false
positive checks in JPEGs with EXIF data with links.

Also deprecates $wgAllowTitlesInSVG and allows it by default.

This should still protect against malformed PNG attacks on old IE
versions, though false positive checks are conceivable on PNG files
containing comments very close to the beginning of the file.

Adds $wgVerifyMimeTypeIE config var to allow disabling the IE checks
entirely, if desired, but leaves it in place by default. These are
more conservative than the checks that were removed.

Added test cases for the old IE5/6 bug and the particular sort of
JPEG metadata that struck false positives previously.

Bug: T27707
Change-Id: I66642a74fce1a1894cad67d62b0da61020db469a

4 years agoAPI: Apply miser-mode namespace check for generator=redirects
Brad Jorsch [Fri, 24 May 2019 13:19:49 +0000 (09:19 -0400)]
API: Apply miser-mode namespace check for generator=redirects

Bug: T224246
Change-Id: Icad65fcc14ad91d302c8285e08d6a7ea299a90c6

4 years agoFix documentation of Maintenance::updateSearchIndex
Umherirrender [Fri, 7 Jun 2019 17:22:19 +0000 (19:22 +0200)]
Fix documentation of Maintenance::updateSearchIndex

Document callback as callable type and the results part as
IResultWrapper to match the implementation, which is passing return of
Database::query to this function

Change-Id: I63ee8d4907590a21ef34d0b761b8fabfe0ff2569

4 years agoPass options as array to IDatabase::insert
Umherirrender [Fri, 7 Jun 2019 17:12:35 +0000 (19:12 +0200)]
Pass options as array to IDatabase::insert

The documentation only allows arrays there

Change-Id: I00c6e47a817a70bed9a443aebc675ef4c3d6b1e5

4 years agoChange array type on ApiQueryBase::addTables
Umherirrender [Fri, 7 Jun 2019 15:19:48 +0000 (17:19 +0200)]
Change array type on ApiQueryBase::addTables

This function results in passing its value to IDatabase::select as first
parameter $table.
The first parameter is documented as string|array, because it can take
more complex arrays:
 * Joins using parentheses for grouping (since MediaWiki 1.31) may be
 * constructed using nested arrays. For example,
 *
 *    [ 'tableA', 'nestedB' => [ 'tableB', 'b2' => 'tableB2' ] ]

Update the type to allow also passing such complex arrays to this
function
ApiQueryBase::showHiddenUsersAddBlockInfo() is using this format

Change-Id: I8038243545bc1c79a1106ccc3bec7738e63c2e2e

4 years agoRemove return value from SpecialUploadStash::execute
Umherirrender [Mon, 3 Jun 2019 19:14:13 +0000 (21:14 +0200)]
Remove return value from SpecialUploadStash::execute

SpecialPage::execute never returns anything
Also remove the return value from the functions called here.
The special page is using exceptions instead of a bool to indicate
failure and success

Change-Id: Ia271fe06b8ce888a8448099020f7aedf23af30db

4 years agoNormalize dir path in AutoLoaderStructureTest
Lucas Werkmeister [Mon, 20 May 2019 15:09:37 +0000 (17:09 +0200)]
Normalize dir path in AutoLoaderStructureTest

The file paths we inspect are always normalized (File_Iterator_Facade
applies realpath()), but the directory we compare against may not be,
depending on how wfLoadExtension() was called. Normalize the directory
before we remove the directory prefix from each file, so that we don’t
end up stripping away the wrong parts of the path.

Change-Id: Ib272fb892c18d989f8d439ed50c6a5a8fd542cc9

4 years agoMerge "Add missing Title::newFromLinkTarget to api module compare"
jenkins-bot [Fri, 7 Jun 2019 08:11:27 +0000 (08:11 +0000)]
Merge "Add missing Title::newFromLinkTarget to api module compare"

4 years agoMerge "Fix ServiceOptions type in constructor documentation"
jenkins-bot [Fri, 7 Jun 2019 08:05:54 +0000 (08:05 +0000)]
Merge "Fix ServiceOptions type in constructor documentation"

4 years agoMerge "WatchedItemStore::getWatchedItem returns a WatchedItem"
jenkins-bot [Fri, 7 Jun 2019 08:05:03 +0000 (08:05 +0000)]
Merge "WatchedItemStore::getWatchedItem returns a WatchedItem"

4 years agoAdd 1.27.7 to HISTORY
Reedy [Fri, 7 Jun 2019 01:31:44 +0000 (02:31 +0100)]
Add 1.27.7 to HISTORY

Change-Id: If41890454e3487b6b7803a1671915041c53f9561

4 years agoBring in HISTORY for 1.27.6/1.30.2/1.31.2/1.32.2
Reedy [Fri, 7 Jun 2019 00:08:20 +0000 (01:08 +0100)]
Bring in HISTORY for 1.27.6/1.30.2/1.31.2/1.32.2

Bug: T205046
Change-Id: Ib4819bf71c22873a4b16c55b7e22d0f33aa07148

4 years agoFix spelling error in test function name
Thalia [Thu, 6 Jun 2019 21:29:02 +0000 (17:29 -0400)]
Fix spelling error in test function name

Change-Id: Ib9b83f6936a3ba86dbb7537d9cef7810c8bc36db

4 years agoMerge "SECURITY: resources: Patch jQuery 3.3.1 for CVE-2019-11358"
jenkins-bot [Thu, 6 Jun 2019 20:37:15 +0000 (20:37 +0000)]
Merge "SECURITY: resources: Patch jQuery 3.3.1 for CVE-2019-11358"

4 years agoMerge "SECURITY: Add permission check for user is permitted to view the log type"
jenkins-bot [Thu, 6 Jun 2019 20:37:09 +0000 (20:37 +0000)]
Merge "SECURITY: Add permission check for user is permitted to view the log type"

4 years agoMerge "SECURITY: Add permission check for user is permitted to view the log type"
jenkins-bot [Thu, 6 Jun 2019 20:36:18 +0000 (20:36 +0000)]
Merge "SECURITY: Add permission check for user is permitted to view the log type"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 6 Jun 2019 20:14:43 +0000 (22:14 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I33e9fe577fee1d6203e2f91d143c25b1d2291bd5

4 years agoAdd missing Title::newFromLinkTarget to api module compare
Umherirrender [Thu, 6 Jun 2019 20:10:57 +0000 (22:10 +0200)]
Add missing Title::newFromLinkTarget to api module compare

The function getArticleID is not implemented by a LinkTarget as returned
by getPageAsLinkTarget, so this needs a wrapper to create a Title
object.
ApiQueryBase::addTitleInfo also needs a Title object to call
getPrefixedText

Change-Id: I8d1b4a77da8b3ce4eaf9e7e5100a3243669f2d3e

4 years agoFix ServiceOptions type in constructor documentation
Umherirrender [Thu, 6 Jun 2019 19:59:27 +0000 (21:59 +0200)]
Fix ServiceOptions type in constructor documentation

Change-Id: I3fcde4e484ddd6d86e4ca12dcf5977051e7f4cf2

4 years agoUse IResultWrapper in LinkBatch and BacklinkCache
Umherirrender [Thu, 6 Jun 2019 19:56:18 +0000 (21:56 +0200)]
Use IResultWrapper in LinkBatch and BacklinkCache

Change-Id: If96d6dfeea17e73073b78c19526787e788f7b412

4 years agoMerge "Log headers sent errors more usefully in thumb.php"
jenkins-bot [Thu, 6 Jun 2019 19:34:22 +0000 (19:34 +0000)]
Merge "Log headers sent errors more usefully in thumb.php"

4 years agoMerge "SECURITY: Fix cache mode for (un)patrolled recent changes query"
jenkins-bot [Thu, 6 Jun 2019 19:15:19 +0000 (19:15 +0000)]
Merge "SECURITY: Fix cache mode for (un)patrolled recent changes query"

4 years agoSECURITY: resources: Patch jQuery 3.3.1 for CVE-2019-11358
James D. Forrester [Thu, 25 Apr 2019 21:12:52 +0000 (16:12 -0500)]
SECURITY: resources: Patch jQuery 3.3.1 for CVE-2019-11358

Patch taken from https://github.com/DanielRuf/snyk-js-jquery-174006?files=1
and left in-repo. Note that this will break the foreign resources check,
which is not currently a unit test but was planned to become such soon.

Bug: T221739
Change-Id: I99c2be81c74a8f1d35c421f0ee43c75efb30a7d0

4 years agoSECURITY: Add permission check for user is permitted to view the log type
rxy [Sun, 28 Apr 2019 20:14:18 +0000 (05:14 +0900)]
SECURITY: Add permission check for user is permitted to view the log type

Bug: T222038
Change-Id: I92ec2adfd9c514b3be1c07b7d22b9f9722d24a82

4 years agoSECURITY: Add permission check for user is permitted to view the log type
rxy [Sun, 28 Apr 2019 20:04:01 +0000 (05:04 +0900)]
SECURITY: Add permission check for user is permitted to view the log type

Bug: T222036
Change-Id: I7584ee8db23a8834bbab21e355cab9857a293f72

4 years agoMerge "SECURITY: API: Respect $wgBlockCIDRLimit in action=block"
jenkins-bot [Thu, 6 Jun 2019 18:59:45 +0000 (18:59 +0000)]
Merge "SECURITY: API: Respect $wgBlockCIDRLimit in action=block"

4 years agoMerge "SECURITY: rate-limit and prevent blocked users from changing email"
jenkins-bot [Thu, 6 Jun 2019 18:59:38 +0000 (18:59 +0000)]
Merge "SECURITY: rate-limit and prevent blocked users from changing email"

4 years agoMerge "SECURITY: blacklist CSS var()"
jenkins-bot [Thu, 6 Jun 2019 18:59:30 +0000 (18:59 +0000)]
Merge "SECURITY: blacklist CSS var()"

4 years agoMerge "SECURITY: Fix reauth in Special:ChangeEmail"
jenkins-bot [Thu, 6 Jun 2019 18:26:01 +0000 (18:26 +0000)]
Merge "SECURITY: Fix reauth in Special:ChangeEmail"

4 years agoSECURITY: Fix cache mode for (un)patrolled recent changes query
Lucas Werkmeister [Mon, 17 Dec 2018 13:02:39 +0000 (14:02 +0100)]
SECURITY: Fix cache mode for (un)patrolled recent changes query

Restricting the list of recent changes to patrolled, not patrolled,
autopatrolled, not autopatrolled, or unpatrolled recent changes requires
special permissions (as does displaying that status in the properties of
returned entries), but we only set the cache mode to private in the
first two cases.

Bug: T212118
Change-Id: I4c3fe6e47f80ebf97fa37875c704328d08772d26

4 years agoSECURITY: API: Respect $wgBlockCIDRLimit in action=block
Kunal Mehta [Fri, 13 Jul 2018 15:07:51 +0000 (08:07 -0700)]
SECURITY: API: Respect $wgBlockCIDRLimit in action=block

$wgBlockCIDRLimit states how large rangeblocks are allowed to be for IPv4
and IPv6. The API now calls SpecialBlock::validateTarget() to perform
that validation step.

As a minor thing, SpecialBlock::checkUnblockSelf() is now called twice by
the API, but that can probably be cleaned up at another time.

Tests included.

Bug: T199540
Change-Id: Ic7d60240d9ebd9580c0eb3b41e4befceab69bd81

4 years agoSECURITY: rate-limit and prevent blocked users from changing email
Brian Wolff [Wed, 21 Nov 2018 16:15:28 +0000 (16:15 +0000)]
SECURITY: rate-limit and prevent blocked users from changing email

This is to counter spam where people use Special:ChangeEmail to
spam people with the confirmation email and using the username
to promote their thing

Bug: T209794
Change-Id: I8b2bd0f60c66f44c91dc78e3512a73e4237df2f3

4 years agoSECURITY: blacklist CSS var()
Max Semenik [Wed, 7 Nov 2018 02:38:22 +0000 (18:38 -0800)]
SECURITY: blacklist CSS var()

Bug: T208881
Change-Id: I9a4ced2bc47eb5f96cf35e693bf5261c48acb126

4 years agoSECURITY: Fix reauth in Special:ChangeEmail
Brian Wolff [Fri, 15 Jun 2018 08:19:49 +0000 (08:19 +0000)]
SECURITY: Fix reauth in Special:ChangeEmail

Previously you could bypass reauthentication by directly
POSTing to Special:ChangeEmail.

Bug: T197279
Change-Id: I674557351e0e91a8105c12ddf6cd30283aac9f7a

4 years agoAdd some @since tags to HeaderCallback
Reedy [Thu, 6 Jun 2019 15:14:58 +0000 (16:14 +0100)]
Add some @since tags to HeaderCallback

Change-Id: I28053418d107f4a101aa7d8a2203c6864acd311f

4 years agoLog headers sent errors more usefully in thumb.php
Gergő Tisza [Thu, 6 Jun 2019 14:21:21 +0000 (16:21 +0200)]
Log headers sent errors more usefully in thumb.php

Bug: T225197
Change-Id: Ifcb02b3d5794061f27c005b32164ac014f926357