lhc/web/wiklou.git
5 years agoMerge "redo: don't die producing xml files if rev text export conversion fails"
jenkins-bot [Mon, 8 Apr 2019 18:55:30 +0000 (18:55 +0000)]
Merge "redo: don't die producing xml files if rev text export conversion fails"

5 years agoMerge "Update table header color of `.mw-datatable`"
jenkins-bot [Mon, 8 Apr 2019 18:17:39 +0000 (18:17 +0000)]
Merge "Update table header color of `.mw-datatable`"

5 years agoMerge "Use IMaintainableDatabase type hint for DatabaseUpdater::newForDB()"
jenkins-bot [Mon, 8 Apr 2019 15:21:28 +0000 (15:21 +0000)]
Merge "Use IMaintainableDatabase type hint for DatabaseUpdater::newForDB()"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 8 Apr 2019 06:07:06 +0000 (08:07 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I1dcfd8baa72e77a0c43a30270cf3c39810f29760

5 years agoUpdate table header color of `.mw-datatable`
Volker E [Mon, 8 Apr 2019 05:30:01 +0000 (22:30 -0700)]
Update table header color of `.mw-datatable`

Bug: T214208
Change-Id: Id5f14b9a3af40a83385dcb4baf0e2d464c5e07a9

5 years agoMerge "Fix phpdoc for type hint for User::makeUpdateConditions()"
jenkins-bot [Mon, 8 Apr 2019 04:51:21 +0000 (04:51 +0000)]
Merge "Fix phpdoc for type hint for User::makeUpdateConditions()"

5 years agoMerge "resourceloader: Remove unused 'skipped' property from registry"
jenkins-bot [Mon, 8 Apr 2019 03:54:10 +0000 (03:54 +0000)]
Merge "resourceloader: Remove unused 'skipped' property from registry"

5 years agoMerge "resourceloader: Move registration of Resources.php to ServiceWiring"
jenkins-bot [Mon, 8 Apr 2019 03:54:04 +0000 (03:54 +0000)]
Merge "resourceloader: Move registration of Resources.php to ServiceWiring"

5 years agoFix phpdoc for type hint for User::makeUpdateConditions()
Aaron Schulz [Mon, 8 Apr 2019 03:46:22 +0000 (20:46 -0700)]
Fix phpdoc for type hint for User::makeUpdateConditions()

Change-Id: I46b3842495b3b9b8d44d16f434de4b44c65c1d80

5 years agoUse IMaintainableDatabase type hint for DatabaseUpdater::newForDB()
Aaron Schulz [Mon, 8 Apr 2019 03:44:46 +0000 (20:44 -0700)]
Use IMaintainableDatabase type hint for DatabaseUpdater::newForDB()

Change-Id: I56dd9f8d195ad60cf3ec9b81af2b4f25d1ca0a3a

5 years agoresourceloader: Remove unused 'skipped' property from registry
Timo Tijhof [Mon, 8 Apr 2019 00:20:06 +0000 (01:20 +0100)]
resourceloader: Remove unused 'skipped' property from registry

This was added for debugging purposes, but I've never needed it
so far. It also makes the shape of objects in the registry
inconsistent, which can be a de-opt.

Keep it for now, but with a more minimal impact by storing it
in the same property.

Change-Id: I297e3adb4765b83b1e7356b81cd056f99b3de93d

5 years agoMerge "Replace deprecated function wfEscapeShellArg with Shell::escape()"
jenkins-bot [Sun, 7 Apr 2019 22:42:26 +0000 (22:42 +0000)]
Merge "Replace deprecated function wfEscapeShellArg with Shell::escape()"

5 years agoReplace deprecated function wfEscapeShellArg with Shell::escape()
Derick Alangi [Sun, 7 Apr 2019 11:36:22 +0000 (12:36 +0100)]
Replace deprecated function wfEscapeShellArg with Shell::escape()

Change-Id: I4046d593d1450cfffc489ca2abadba1084a540e4

5 years agoMerge "Improve docs for Title::getInternalURL/getCanonicalURL"
jenkins-bot [Sun, 7 Apr 2019 17:25:33 +0000 (17:25 +0000)]
Merge "Improve docs for Title::getInternalURL/getCanonicalURL"

5 years agoMake Special:Version escape extension names that aren't links
Brian Wolff [Sun, 17 Feb 2019 11:09:45 +0000 (11:09 +0000)]
Make Special:Version escape extension names that aren't links

This is to make phan-taint-check happy. Technically this is
a breaking change, but I am unaware of any extensions actually
having their names be arbitrary html, and support for this
is not documented anywhere.

Bug: T216348
Change-Id: I065d7e57f36e079e0b02180379e2df1f8535f3a8

5 years agoMerge "resourceloader: Fix ensureNewline( '' ) support for PHP 7"
jenkins-bot [Sun, 7 Apr 2019 16:52:25 +0000 (16:52 +0000)]
Merge "resourceloader: Fix ensureNewline( '' ) support for PHP 7"

5 years agoMerge "resourceloader: Use self::class instead of 'self'"
jenkins-bot [Sun, 7 Apr 2019 16:52:20 +0000 (16:52 +0000)]
Merge "resourceloader: Use self::class instead of 'self'"

5 years agoMerge "Fix/suppress phan errors related to arrays (#11)"
jenkins-bot [Sun, 7 Apr 2019 16:44:03 +0000 (16:44 +0000)]
Merge "Fix/suppress phan errors related to arrays (#11)"

5 years agoresourceloader: Fix ensureNewline( '' ) support for PHP 7
Fomafix [Sun, 7 Apr 2019 10:08:17 +0000 (12:08 +0200)]
resourceloader: Fix ensureNewline( '' ) support for PHP 7

substr( '', -1 ) returns '', not false, in PHP 7.

Change-Id: Ie48fe064385e70f070e3fbfe0b62198f36cccd6d

5 years agoresourceloader: Use self::class instead of 'self'
Fomafix [Sun, 7 Apr 2019 11:49:26 +0000 (13:49 +0200)]
resourceloader: Use self::class instead of 'self'

Change-Id: I66d9974875d404fb5f7669f3962e694e1d56c350

5 years agoFix/suppress phan errors related to arrays (#11)
Kunal Mehta [Sun, 7 Apr 2019 07:11:39 +0000 (00:11 -0700)]
Fix/suppress phan errors related to arrays (#11)

Change-Id: Ie5c05fbc88c51d493bc1462005d2f8dde5f72101

5 years agoMerge "Change Database type hints to use IDatabase"
jenkins-bot [Sun, 7 Apr 2019 09:13:34 +0000 (09:13 +0000)]
Merge "Change Database type hints to use IDatabase"

5 years agoMerge "Fix phan errors by improving documentation (#10)"
jenkins-bot [Sun, 7 Apr 2019 09:13:15 +0000 (09:13 +0000)]
Merge "Fix phan errors by improving documentation (#10)"

5 years agoMerge "Fix PhanPluginDuplicateExpressionBinaryOp in DjVuImage (#9)"
jenkins-bot [Sun, 7 Apr 2019 09:13:09 +0000 (09:13 +0000)]
Merge "Fix PhanPluginDuplicateExpressionBinaryOp in DjVuImage (#9)"

5 years agoMerge "Fix misc phan errors by adjusting documentation (#8)"
jenkins-bot [Sun, 7 Apr 2019 09:13:03 +0000 (09:13 +0000)]
Merge "Fix misc phan errors by adjusting documentation (#8)"

5 years agoMerge "Follow-up 8e1342ed47: Add @since for Title::NEW_CLONE"
jenkins-bot [Sun, 7 Apr 2019 02:32:40 +0000 (02:32 +0000)]
Merge "Follow-up 8e1342ed47: Add @since for Title::NEW_CLONE"

5 years agoChange Database type hints to use IDatabase
Aaron Schulz [Sat, 6 Apr 2019 23:29:36 +0000 (16:29 -0700)]
Change Database type hints to use IDatabase

Change-Id: Ie1e86cd961a619335138402ba22fe2a73a3e62fd

5 years agoMerge "debug: Use __CLASS__ to get the name of the class"
jenkins-bot [Sun, 7 Apr 2019 01:08:04 +0000 (01:08 +0000)]
Merge "debug: Use __CLASS__ to get the name of the class"

5 years agoMerge "resourceloader: Add missing (string) cast to ClientHtml tests"
jenkins-bot [Sun, 7 Apr 2019 01:03:25 +0000 (01:03 +0000)]
Merge "resourceloader: Add missing (string) cast to ClientHtml tests"

5 years agoMerge "phpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestLis...
jenkins-bot [Sun, 7 Apr 2019 01:02:12 +0000 (01:02 +0000)]
Merge "phpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestListener"

5 years agodebug: Use __CLASS__ to get the name of the class
Derick Alangi [Wed, 27 Mar 2019 11:35:40 +0000 (12:35 +0100)]
debug: Use __CLASS__ to get the name of the class

self::class would have been better here for consistency across
the code base but seems HHVM handles self::class diferrently from
PHP 7, when used inside a trait. The difference is significant to the
tests and thus we keep the result the same by using __CLASS__ instead.

Change-Id: I58b452341a0567f4d6e6636a7e489531a5569d20

5 years agoFollow-up 8e1342ed47: Add @since for Title::NEW_CLONE
James D. Forrester [Sun, 7 Apr 2019 00:28:43 +0000 (17:28 -0700)]
Follow-up 8e1342ed47: Add @since for Title::NEW_CLONE

Change-Id: I6ad81dad179b2f2f009c8dc43f51eb0083c066f3

5 years agoMerge "mediawiki.Title: Remove redundant closure"
jenkins-bot [Sat, 6 Apr 2019 23:54:02 +0000 (23:54 +0000)]
Merge "mediawiki.Title: Remove redundant closure"

5 years agoresourceloader: Move registration of Resources.php to ServiceWiring
Timo Tijhof [Sat, 6 Apr 2019 20:41:36 +0000 (21:41 +0100)]
resourceloader: Move registration of Resources.php to ServiceWiring

This identified something we hadn't codified before which is that
we expect the 'startup' module to always exist. The code and tests
for ResourceLoaderClientHtml also assume this, which we now
acknowledge explicitly by leaving it in the constructor.

Bug: T32956
Change-Id: Iffc545eb32078aed0d059e5902a5c9382e14c641

5 years agomediawiki.Title: Remove redundant closure
Timo Tijhof [Sat, 6 Apr 2019 20:34:17 +0000 (21:34 +0100)]
mediawiki.Title: Remove redundant closure

This module is loaded with packageFiles, which is always executed
in module scope (with a closure), even in debug mode.

The behaviour of non-packageFiles debug mode is the only reason
files have closures.

Bug: T50886
Change-Id: I6c0e686cb1d6971a6a9c5eeab2d2a093d2dae2d3

5 years agoresourceloader: Add missing (string) cast to ClientHtml tests
Timo Tijhof [Sat, 6 Apr 2019 23:02:28 +0000 (00:02 +0100)]
resourceloader: Add missing (string) cast to ClientHtml tests

One of the assertions already did this, but the others not yet.

The reason we do this is because the return value is a WrappedString
object. The assertEquals() method is able to satisfy the expected
value because of loose comparison casting it to a string for the
case where it matches.

But, when it fails during development, PHPUnit was still printing
the object as "Actual" and the string as "Expected" which makes
it difficult to understand what's going on, and also no diff.

Change-Id: Ice9fe5061fb76867e9bee2f34c88d3ddac3144f9

5 years agophpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestListener
Timo Tijhof [Sat, 6 Apr 2019 22:53:30 +0000 (23:53 +0100)]
phpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestListener

Follows-up 96657099fc (T217489) adding MediaWikiLoggerPHPUnitTestListener.
It started printing messages from log channels to CLI output when there
is one or more failed assertions. This is useful.

But, it also interacts with MediaWikiPHPUnitTestListener from 2018,
which calls wfDebugLog('PHPUnitCommand', …) for every test and every
assertion. That allows one to later open debug.log and see MediaWiki's
messages interleaved with PHPUnit activity. This provides messages from
a much larger scope (including before test setup, and data providers).

But, this means we get:

 > There were N failures:
 > 1) ExampleTest::testGetThing
 > === Logs generated by test case
 > [PHPUnitCommand] [info] FAILURE in ExampleTest::testGetThing:
 > [PHPUnit\Framework\ExpectationFailedException] Failed asserting …
 > …
 > …
 > …
 > … {"private":false}
 > ===
 > Failed asserting that …
 > --- Expected
 > +++ Actual
 > @@ @@
 > …
 > /var/www/mediawiki/tests/phpunit/includes/…:…

This needlessly repeats the test name and method, and takes up
vertical space to describe the failed assertion in a way that is
less useful than the one that PHPUnit already prints after it.

Exclude these by default from CLI.

Bug: T217489
Change-Id: I0f471f82b16ba869d15389ed470bd73dc6deea78

5 years agoMerge "jobqueue: update claim array in JobQueueMemory::doAck"
jenkins-bot [Sat, 6 Apr 2019 20:15:31 +0000 (20:15 +0000)]
Merge "jobqueue: update claim array in JobQueueMemory::doAck"

5 years agoMerge "rdbms: deprecate unused aggregateValue() method"
jenkins-bot [Sat, 6 Apr 2019 20:03:36 +0000 (20:03 +0000)]
Merge "rdbms: deprecate unused aggregateValue() method"

5 years agoMerge "jobqueue: clean up __construct() signature for some job classes"
jenkins-bot [Sat, 6 Apr 2019 20:02:20 +0000 (20:02 +0000)]
Merge "jobqueue: clean up __construct() signature for some job classes"

5 years agojobqueue: update claim array in JobQueueMemory::doAck
Aaron Schulz [Fri, 5 Apr 2019 00:27:44 +0000 (17:27 -0700)]
jobqueue: update claim array in JobQueueMemory::doAck

Fixes regression from a51ea350bed6f66b.

Change-Id: Id4d703b5537069e785a5c1454b9fc2785494247b

5 years agoMerge "for exports, make sure we compare page titles as strings only"
jenkins-bot [Sat, 6 Apr 2019 18:53:54 +0000 (18:53 +0000)]
Merge "for exports, make sure we compare page titles as strings only"

5 years agojobqueue: clean up __construct() signature for some job classes
Aaron Schulz [Fri, 29 Mar 2019 18:40:59 +0000 (11:40 -0700)]
jobqueue: clean up __construct() signature for some job classes

The $params value should always be an array

Change-Id: If7a0350b64241c7b5bbbdbc7bc90379a93484013

5 years agoMerge "resourceloader: Fix variable spacings where need be"
jenkins-bot [Sat, 6 Apr 2019 15:12:04 +0000 (15:12 +0000)]
Merge "resourceloader: Fix variable spacings where need be"

5 years agoresourceloader: Fix variable spacings where need be
Jack Phoenix [Sat, 6 Apr 2019 12:48:39 +0000 (15:48 +0300)]
resourceloader: Fix variable spacings where need be

This fix is to make sure resource loader code conforms with convension
https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#Spaces.

Change-Id: I34c0a0addbf7c373fc3a64b644a3098bb485a3f4

5 years agoMove PackedHoverImageGallery from PackedOverlayImageGallery.php
Zoranzoki21 [Sat, 6 Apr 2019 12:12:02 +0000 (14:12 +0200)]
Move PackedHoverImageGallery from PackedOverlayImageGallery.php

Change-Id: I7a764fa89637dc7c3865dbbbbe0d90d5bc268ed2

5 years agofor exports, make sure we compare page titles as strings only
Ariel T. Glenn [Sat, 6 Apr 2019 09:24:30 +0000 (12:24 +0300)]
for exports, make sure we compare page titles as strings only

...and not as numbers!! Also added strict compare for the namespaces
field while we're in here.

Bug: T220257
Change-Id: If68b79334188c2f3be5d254bea3c1e27d52c4a9f

5 years agoMerge "rdbms: add and enforce DB_REPLICA/DB_MASTER roles in DBConnRef"
jenkins-bot [Sat, 6 Apr 2019 09:54:16 +0000 (09:54 +0000)]
Merge "rdbms: add and enforce DB_REPLICA/DB_MASTER roles in DBConnRef"

5 years agoMerge "Add Special:Users as a synonym for Special:ListUsers"
jenkins-bot [Sat, 6 Apr 2019 09:34:10 +0000 (09:34 +0000)]
Merge "Add Special:Users as a synonym for Special:ListUsers"

5 years agoFix phan errors by improving documentation (#10)
Kunal Mehta [Sat, 6 Apr 2019 07:07:54 +0000 (00:07 -0700)]
Fix phan errors by improving documentation (#10)

PhanTypeExpectedObjectPropAccess was flagged by phan in the
DatabaseMysqli and Preprocessor_Hash classes.

In Database, the $conn property might be a standard object, such as
`\mysqli`, which is not a resource.

In Preprocessor, phan was getting confused and thinking
PPDStack::getCurrentPart() was returning bool, and not a PPDPart object.
Adding explicit documentation about the return value fixed that.

Change-Id: I0a3aa219693da5cb46ff9c0936841ed740c6968a

5 years agoFix PhanPluginDuplicateExpressionBinaryOp in DjVuImage (#9)
Kunal Mehta [Sat, 6 Apr 2019 06:40:01 +0000 (23:40 -0700)]
Fix PhanPluginDuplicateExpressionBinaryOp in DjVuImage (#9)

== has a higher precedence operator than &.

So the line `$chunkLength & 1 == 1` is interepreted as:
`$chunkLength & true`. Probably not what was intended, but it actually
works out because true is cast to 1, and the expression will either
result with 0 (falsey) or 1 (truthy), and we were looking for it to
equal 1 anyways. Incredible.

I assume that it was supposed to be `( $chunkLength & 1 ) == 1`, so I've
modified it to use that.

Change-Id: If03823b9286e0d8282519949bf46e2ba4cca0843

5 years agoFix misc phan errors by adjusting documentation (#8)
Kunal Mehta [Sat, 6 Apr 2019 06:31:16 +0000 (23:31 -0700)]
Fix misc phan errors by adjusting documentation (#8)

PhanTypeInvalidRightOperand was triggering on
ApiQueryBase::showHiddenUsersAddBlockInfo() on the line
`$actorQuery['tables'] + $commentQuery['tables']` (and the next one).
For whatever reason, phan was unable to automatically understand that
the right side was an array (though it was able to understand
$actorQuery, which has nearly identical code...), so I added more
specific hinting to CommentStore::getJoin() using phan's union types,
which resolved the issue.

And incorrect documentation on LogEntry::getDeleted() was triggering
PhanTypeMismatchBitwiseBinaryOperands since you can't do bitwise
operations on a string and an integer.

Change-Id: I13b791e4b754ffbc340b55cfb752e2d9226f1949

5 years agoFix PhanUnextractableAnnotation* errors (#7)
Kunal Mehta [Sat, 6 Apr 2019 06:19:29 +0000 (23:19 -0700)]
Fix PhanUnextractableAnnotation* errors (#7)

Change-Id: I8194a7b9c9abce951002590030913706e9bd743e

5 years agoFix phan errors in ChangesListSpecialPage (#6)
Kunal Mehta [Sat, 6 Apr 2019 06:10:08 +0000 (23:10 -0700)]
Fix phan errors in ChangesListSpecialPage (#6)

Specifically in registerFiltersFromDefinitions(), phan was unable to
tell that $groupDefinition['class'] was a string. I think it assumed it
was an integer because the earlier $groupDefinition['priority'] was an
integer.

Use phan's more advanced type documentation system to instruct it that
$className will be a string.

Change-Id: I09f41366b713d6159b57e798cfd1720f42ba30ef

5 years agoResync phan error counts
Kunal Mehta [Sat, 6 Apr 2019 06:00:03 +0000 (23:00 -0700)]
Resync phan error counts

Change-Id: I9d893d5d05ff83c8c8e8c807e35fc2474584a24a

5 years agordbms: deprecate unused aggregateValue() method
Aaron Schulz [Fri, 5 Apr 2019 23:59:29 +0000 (16:59 -0700)]
rdbms: deprecate unused aggregateValue() method

Change-Id: I708a5786657e8d22e4b42230bfadb11ce0d7b9ca

5 years agoMerge "Make WrapOldPasswords pass "refresh" to User::clearSharedCache()"
jenkins-bot [Fri, 5 Apr 2019 23:58:12 +0000 (23:58 +0000)]
Merge "Make WrapOldPasswords pass "refresh" to User::clearSharedCache()"

5 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Fri, 5 Apr 2019 23:46:19 +0000 (23:46 +0000)]
Merge "Localisation updates from https://translatewiki.net."

5 years agoMerge "rdbms: Clean up MssqlBlob constructor"
jenkins-bot [Fri, 5 Apr 2019 23:46:14 +0000 (23:46 +0000)]
Merge "rdbms: Clean up MssqlBlob constructor"

5 years agoMerge "Fix/suppress misc phan errors (#5)"
jenkins-bot [Fri, 5 Apr 2019 23:44:43 +0000 (23:44 +0000)]
Merge "Fix/suppress misc phan errors (#5)"

5 years agoMerge "Fix/suppress misc phan errors (#2)"
jenkins-bot [Fri, 5 Apr 2019 23:44:37 +0000 (23:44 +0000)]
Merge "Fix/suppress misc phan errors (#2)"

5 years agoMerge "rdbms: rename DB server index parameter to LoadBalancer::getMaintenanceConnect...
Krinkle [Fri, 5 Apr 2019 23:38:51 +0000 (23:38 +0000)]
Merge "rdbms: rename DB server index parameter to LoadBalancer::getMaintenanceConnectionRef()"

5 years agoMake WrapOldPasswords pass "refresh" to User::clearSharedCache()
Aaron Schulz [Fri, 5 Apr 2019 23:34:49 +0000 (16:34 -0700)]
Make WrapOldPasswords pass "refresh" to User::clearSharedCache()

Change-Id: I944488abce4ea15c2f4954ffb82b0354424335db

5 years agoMerge "build: Updating mediawiki/mediawiki-codesniffer to 25.0.0"
jenkins-bot [Fri, 5 Apr 2019 23:18:01 +0000 (23:18 +0000)]
Merge "build: Updating mediawiki/mediawiki-codesniffer to 25.0.0"

5 years agoFix/suppress misc phan errors (#2)
Kunal Mehta [Fri, 22 Mar 2019 01:12:50 +0000 (18:12 -0700)]
Fix/suppress misc phan errors (#2)

* Title: phan false positive
* McrUndoAction: fixed improper use of @param
* UploadSourceAdapter: fixed wrong type
* XmlTypeCheck: Use null so phan doesn't think we're trying to call the
function ''
* Database: phan false positive
* SpecialBlock: Use phan's advanced type documentation so phan knows
specifically what's being returned
* ChangesListSpecialPage: phan false positive
* BatchRowUpdate: Have default callback take a parameter so phan doesn't
think too many arguments are being passed
* MimeAnalyzer: left FIXME for relying on PHP 7.1 unpack() signature
* LanguageConverter: Specify types for $mTables since phan couldn't
determine it automatically
* preprocessorFuzzTest: Implement User::load() method signature

Change-Id: I08080ab636c5fe67ea6a4e14b2212d7523606e21

5 years agoMerge "Fixes LocalFile isMissing always returning true"
jenkins-bot [Fri, 5 Apr 2019 23:02:04 +0000 (23:02 +0000)]
Merge "Fixes LocalFile isMissing always returning true"

5 years agordbms: Clean up MssqlBlob constructor
Kunal Mehta [Sun, 24 Mar 2019 00:37:20 +0000 (17:37 -0700)]
rdbms: Clean up MssqlBlob constructor

Returning inside PHP constructors doesn't work, so whatever this code
was previously trying to do didn't work. Now we directly set $this->data
to the existing $data->data. Note that we can't fall through to the
instanceof Blob due to MssqlBlob->fetch() not being idempotent.

Also expand the @param documentation for $data.

h/t to phan for highlighting this and Anomie for explaining that the
behavior was wrong and how to properly fix it.

Change-Id: Ied5ba2f63cbaf7c8e0f951000dbc4aa3089edd80

5 years agoFix/suppress misc phan errors (#5)
Kunal Mehta [Fri, 22 Mar 2019 06:11:04 +0000 (23:11 -0700)]
Fix/suppress misc phan errors (#5)

Add lots of missing return statements, or remove incorrect doc blocks.

Change-Id: I0881e98fbb9d0d4cf79ecc824064d24538055d3f

5 years agobuild: Updating mediawiki/mediawiki-codesniffer to 25.0.0
Kunal Mehta [Fri, 5 Apr 2019 22:32:46 +0000 (15:32 -0700)]
build: Updating mediawiki/mediawiki-codesniffer to 25.0.0

Change-Id: I1132bb024abe9a5f8a5374eb062d1b8efbfc3007

5 years agoMerge "Fix/suppress misc phan errors (#4)"
jenkins-bot [Fri, 5 Apr 2019 22:42:35 +0000 (22:42 +0000)]
Merge "Fix/suppress misc phan errors (#4)"

5 years agoMerge "Fix PhanUndeclaredType* errors (#3)"
jenkins-bot [Fri, 5 Apr 2019 22:41:37 +0000 (22:41 +0000)]
Merge "Fix PhanUndeclaredType* errors (#3)"

5 years agoFix/suppress misc phan errors (#4)
Kunal Mehta [Fri, 22 Mar 2019 03:04:43 +0000 (20:04 -0700)]
Fix/suppress misc phan errors (#4)

* RevisionStore: phan is confused by the array not being the callable
* ApiContinuationManger: phan false positive
* ChronologyProtector: fix doc block
* MssqlBlob: phan doesn't like __construct returning things
* WikiPage: Remove Revision typehint that doesn't match doc block

Change-Id: I0661d97424d0ad6f7a3357542e79aceb6a4f6c64

5 years agoFixes LocalFile isMissing always returning true
Juan Osorio [Fri, 5 Apr 2019 21:47:38 +0000 (14:47 -0700)]
Fixes LocalFile isMissing always returning true

Bug: T220244
Change-Id: I6f4e1371759559a14cb7b2125792fcfbba7e4cf3

5 years agoMerge "jobqueue: Change internal $params logic to teach Phan (3)"
jenkins-bot [Fri, 5 Apr 2019 20:27:16 +0000 (20:27 +0000)]
Merge "jobqueue: Change internal $params logic to teach Phan (3)"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 5 Apr 2019 20:07:29 +0000 (22:07 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I6bf15beac4259c667062669f27171fc4f750f28f

5 years agoMake teardownTestDB() close any dangling connections before changing the prefix
Aaron Schulz [Fri, 5 Apr 2019 19:36:34 +0000 (12:36 -0700)]
Make teardownTestDB() close any dangling connections before changing the prefix

Bug: T219673
Change-Id: I028fc16b874cac744f7215601eec754a76f31a3f

5 years agoMerge "media: Convert JpegHandler to shell execution framework"
jenkins-bot [Fri, 5 Apr 2019 18:02:33 +0000 (18:02 +0000)]
Merge "media: Convert JpegHandler to shell execution framework"

5 years agojobqueue: Change internal $params logic to teach Phan (3)
Timo Tijhof [Fri, 5 Apr 2019 00:09:30 +0000 (01:09 +0100)]
jobqueue: Change internal $params logic to teach Phan (3)

Follows-up 9b4938c40d02c4bff6f1558, and 766549999c.

It seems despite being optional and documented as 'array|Title',
Phan still thinks it is wrong to pass Title.

Try removing the explicit default of empty array,
the lower code already does this anyway.

This should fix build failures that are preventing merges
in repos where Phan is finding Job::__construct(string, Title)
where it currently fails as follows:

 CompileArticleMetadataJob.php:11
 PhanTypeMismatchArgument Argument 2 (params) is …\Title|string but
 \Job::__construct() takes array

Change-Id: I1c3aee273e0917e30b9c18b49b24fc7f966ff57c

5 years agoMerge "Remove broken explode() from MediaWikiMediaTestCase::dataFile()"
jenkins-bot [Fri, 5 Apr 2019 17:55:40 +0000 (17:55 +0000)]
Merge "Remove broken explode() from MediaWikiMediaTestCase::dataFile()"

5 years agoMerge "Remove warning for unnused 4th argument on wikidiff2"
jenkins-bot [Fri, 5 Apr 2019 16:53:30 +0000 (16:53 +0000)]
Merge "Remove warning for unnused 4th argument on wikidiff2"

5 years agoMerge "Introduce PermissionManager service"
jenkins-bot [Fri, 5 Apr 2019 16:45:32 +0000 (16:45 +0000)]
Merge "Introduce PermissionManager service"

5 years agoMerge "Introduce 'clone' flag for newFromLinkTarget."
jenkins-bot [Fri, 5 Apr 2019 16:45:23 +0000 (16:45 +0000)]
Merge "Introduce 'clone' flag for newFromLinkTarget."

5 years agoRemove warning for unnused 4th argument on wikidiff2
WMDE-Fisch [Fri, 5 Apr 2019 16:23:49 +0000 (18:23 +0200)]
Remove warning for unnused 4th argument on wikidiff2

Since we changed the signature back to 3 arguments in wikidiff2 verion
1.8.0, the warning is invalid.

Bug: T220217
Bug: T203069
Bug: T194272
Change-Id: Ia326c67de28a4e9b024466c62097b4e1e1096007

5 years agojobqueue: Document Title as valid param type for compat (2)
Timo Tijhof [Fri, 5 Apr 2019 00:09:30 +0000 (01:09 +0100)]
jobqueue: Document Title as valid param type for compat (2)

Follows-up 9b4938c40d02c, and 4bff6f1558. The latter of which
updated ::factory() instead of __construct(). Oops.

This should fix build failures that are preventing merges
in repos where Phan is finding Job::__construct(string, Title)
where it currently fails as follows:

 CompileArticleMetadataJob.php:11
 PhanTypeMismatchArgument Argument 2 (params) is …\Title|string but
 \Job::__construct() takes array

As Phan is reading the php doc I guess.

Change-Id: I128d57ead6bcb9dbae99d41a1f23192c3f6fbdba

5 years agoMerge "Clean up LoadBalancerTest and move more code to private methods"
jenkins-bot [Fri, 5 Apr 2019 16:00:09 +0000 (16:00 +0000)]
Merge "Clean up LoadBalancerTest and move more code to private methods"

5 years agoIntroduce PermissionManager service
Vedmaka [Thu, 7 Mar 2019 20:02:07 +0000 (23:02 +0300)]
Introduce PermissionManager service

First iteration of adding a PermissionManager service as a replacement
for Title::userCan and User::isBlockedFrom methods.

- Created PermissionManager service
- Migrated Title::userCan to PermissionManager::userCan and deprecated the first
- Migrated Title::quickUserCan to PermissionManager::quickUserCan and deprecated the first
- Migrated User::isBlockedFrom to PermissionManager::isBlockedFrom and deprecated the first

Same for User::isBlockedFrom and PermissionManager::isBlockedFrom - the
$user parameter is now required so the declaration is changed from
isBlockedFrom( $title, ... ) to isBlockedFrom( $user, $title, .. ) which
means before User::isBlockedFrom removal all calls to it need to be updated.

Added PermissionManagerTest, it copies TitlePermissionTest but uses
PermissionManager instance instead of Title methods, this way keeping both tests
in place, we can ensure that nothing was broken and both are in working state
during the deprecation phase.

Bug: T208768
Change-Id: I94479b44afb3068695f8e327b46bda38e44e691f

5 years agoIntroduce 'clone' flag for newFromLinkTarget.
daniel [Wed, 3 Apr 2019 08:47:57 +0000 (10:47 +0200)]
Introduce 'clone' flag for newFromLinkTarget.

The "new" part of some of the newXXX pseudo-constructors
in the Title class is a lie: these methods do not always
return a new instance. This patch ensures that this fact is
documented, and we have a safe way to get a fresh Title
from a LinkTarget.

Needed by I94479b44afb30

Change-Id: I4d561ef7d7447d3d6e35079cf656bd564882d25e

5 years agoAdd some more missing limit parameters to explode() calls
Thiemo Kreuz [Tue, 26 Mar 2019 10:50:17 +0000 (11:50 +0100)]
Add some more missing limit parameters to explode() calls

I benchmarked this again. The runtime of an unlimited explode() can be
quite high. This is not really a DoS attack vector as it would require to
post megabytes worth of input to the code, which will hit many other
limits before. I still consider it good practice to use unlimited explode()
only when it is actually allowed to return an unlimited amount of elements.

Change-Id: I30f8ca5dba7b317bb4a046b9740fd736b4eea291

5 years agordbms: add and enforce DB_REPLICA/DB_MASTER roles in DBConnRef
Aaron Schulz [Thu, 21 Mar 2019 16:10:23 +0000 (09:10 -0700)]
rdbms: add and enforce DB_REPLICA/DB_MASTER roles in DBConnRef

Even if there is only one database, if a DB_REPLICA connection
reference is obtained and an attempt is made to write it then
it will still fail. This can make it easier to spot incorrect
database usage even in a simple vanilla developer environment.

Note that methods like ILoadBalancer::getConnectionRef() can
be used for local connections as well as foreign ones.

Change-Id: I5523daad1bdd64624d3e0dd41bfd8d078b1078b0

5 years ago[i18n] Update Czech translations of special pages
Martin Urbanec [Fri, 5 Apr 2019 06:43:26 +0000 (08:43 +0200)]
[i18n] Update Czech translations of special pages

Change-Id: I0c17dd0972623ba75b4f7e4b2fced59add402bbb

5 years agordbms: rename DB server index parameter to LoadBalancer::getMaintenanceConnectionRef()
Aaron Schulz [Fri, 5 Apr 2019 04:20:26 +0000 (21:20 -0700)]
rdbms: rename DB server index parameter to LoadBalancer::getMaintenanceConnectionRef()

Change-Id: I4a7a72f8cf61a0cc21d88cbb62614221f42e0540

5 years agoClean up LoadBalancerTest and move more code to private methods
Aaron Schulz [Fri, 5 Apr 2019 04:18:37 +0000 (21:18 -0700)]
Clean up LoadBalancerTest and move more code to private methods

Change-Id: I4c541537f9b95918f8d1a057ccbc29e8525ddc15

5 years agoMerge "jobqueue: Document Title as valid param type for compat"
jenkins-bot [Fri, 5 Apr 2019 02:37:49 +0000 (02:37 +0000)]
Merge "jobqueue: Document Title as valid param type for compat"

5 years agoMerge "Add missing transaction round commit calls to RefreshLinksJob"
jenkins-bot [Fri, 5 Apr 2019 00:46:45 +0000 (00:46 +0000)]
Merge "Add missing transaction round commit calls to RefreshLinksJob"

5 years agomedia: Convert JpegHandler to shell execution framework
Max Semenik [Sun, 17 Mar 2019 05:45:17 +0000 (22:45 -0700)]
media: Convert JpegHandler to shell execution framework

Change-Id: I99dbdf9108d3b3dc82acd0ca7ba5da9645f41790

5 years agojobqueue: Document Title as valid param type for compat
Timo Tijhof [Fri, 5 Apr 2019 00:09:30 +0000 (01:09 +0100)]
jobqueue: Document Title as valid param type for compat

Follows-up 9b4938c40d02c.

This should fix build failures that are preventing merges
in repos where Phan is finding Job::__construct(string, Title)
where it currently fails as follows:

 CompileArticleMetadataJob.php:11
 PhanTypeMismatchArgument Argument 2 (params) is …\Title|string but
 \Job::__construct() takes array

As Phan is reading the php doc I guess.

Change-Id: I94b442f06b6858d136546bf22f2465cf8f071ab0

5 years agoAdd missing transaction round commit calls to RefreshLinksJob
Aaron Schulz [Thu, 4 Apr 2019 23:25:00 +0000 (16:25 -0700)]
Add missing transaction round commit calls to RefreshLinksJob

Follow-up to 83933a436e1ee9d

Bug: T220037
Change-Id: Ib1ac31365f9c325c56bae11aefe825ad2b2be881

5 years agoMerge "Add meta=userinfo&uiprop=latestcontrib"
jenkins-bot [Thu, 4 Apr 2019 23:23:54 +0000 (23:23 +0000)]
Merge "Add meta=userinfo&uiprop=latestcontrib"

5 years agoUpdate OOUI to v0.31.3
Volker E [Thu, 4 Apr 2019 21:29:43 +0000 (14:29 -0700)]
Update OOUI to v0.31.3

Release notes:
 https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.31.3

Bug: T193731
Bug: T194523
Bug: T217381
Bug: T218408
Bug: T219033
Bug: T219826
Depends-On: I94d1fd4398ec92c2ec63ebf1e57b3b4fc72bd76a
Change-Id: Ibb276860815fc29beaea131401bb5dfeca5159d6

5 years agoMerge "Use HTTP method as hint for the locking mode of sqlite"
jenkins-bot [Thu, 4 Apr 2019 21:08:56 +0000 (21:08 +0000)]
Merge "Use HTTP method as hint for the locking mode of sqlite"