lhc/web/wiklou.git
4 years agoCorrected grammatical error.
Michal [Wed, 8 May 2019 19:32:21 +0000 (15:32 -0400)]
Corrected grammatical error.

Change-Id: I4af843238ffd58925f57c0f7b98253a90cb284ec

4 years agomw.widgets.TitleWidget: Don't allow interwiki links by default
Ed Sanders [Wed, 8 May 2019 18:27:41 +0000 (13:27 -0500)]
mw.widgets.TitleWidget: Don't allow interwiki links by default

Technically this is a breaking change, but the only user of this
widget that wants to support interwikis in the VE link inspector,
and that is currently broken anyway due to a Parsoid bug.

Bug: T222831
Change-Id: I3b8fca39a668e657b66a7836d4ba59183eceb4b4

4 years agoFix Block::newLoad for IPv6 range blocks - follow-up to Ie8bebd8
Thalia [Wed, 8 May 2019 17:49:18 +0000 (12:49 -0500)]
Fix Block::newLoad for IPv6 range blocks - follow-up to Ie8bebd8

Previously, the size of the range is calculated by finding the
difference between that start and end addresses, converted into
decimal. This fails when the numbers are too large.

Instead, use parsing methods from IP class to avoid having to
handle large numbers.

Bug: T222246
Change-Id: If466139c42c4ac832a9506c80bdb228e9da39638

4 years agoMerge "WebRequest: Change getFullRequestURL() to use local getProtocol()"
jenkins-bot [Wed, 8 May 2019 18:20:33 +0000 (18:20 +0000)]
Merge "WebRequest: Change getFullRequestURL() to use local getProtocol()"

4 years agoMerge "FauxRequest: Remove influence from $wgRequest on getFullRequestURL()"
jenkins-bot [Wed, 8 May 2019 18:20:15 +0000 (18:20 +0000)]
Merge "FauxRequest: Remove influence from $wgRequest on getFullRequestURL()"

4 years agoMerge "Update special page aliases for Serbian"
jenkins-bot [Wed, 8 May 2019 18:07:26 +0000 (18:07 +0000)]
Merge "Update special page aliases for Serbian"

4 years agoMerge "Remove parameter 'options' from hook 'SkinEditSectionLinks'"
jenkins-bot [Wed, 8 May 2019 17:48:39 +0000 (17:48 +0000)]
Merge "Remove parameter 'options' from hook 'SkinEditSectionLinks'"

4 years agoMerge "HTML escape parameter 'text' of hook 'SkinEditSectionLinks'"
jenkins-bot [Wed, 8 May 2019 17:48:33 +0000 (17:48 +0000)]
Merge "HTML escape parameter 'text' of hook 'SkinEditSectionLinks'"

4 years agoMerge "Make Installer::parse not be parseAsBlock"
jenkins-bot [Wed, 8 May 2019 17:31:55 +0000 (17:31 +0000)]
Merge "Make Installer::parse not be parseAsBlock"

4 years agoMerge "Revision history: Use `padding` for same rendering"
jenkins-bot [Wed, 8 May 2019 17:06:02 +0000 (17:06 +0000)]
Merge "Revision history: Use `padding` for same rendering"

4 years agoMake Installer::parse not be parseAsBlock
Brian Wolff [Mon, 8 Apr 2019 02:24:57 +0000 (02:24 +0000)]
Make Installer::parse not be parseAsBlock

Previously all the checkboxes had newlines before their labels
which looked really broken.

Change-Id: I5e17524d90d10867ed27553a90cfb246984486d3

4 years agomw.widgets.TitleWidget: Replace last local icons with new OOUI ones
James D. Forrester [Wed, 8 May 2019 16:06:14 +0000 (09:06 -0700)]
mw.widgets.TitleWidget: Replace last local icons with new OOUI ones

Bug: T222079
Change-Id: Icb966871d904a03e96d5395ec755635c46743b09

4 years agoMake skins/README looks like extensions/README file
zoranzoki21 [Wed, 8 May 2019 13:41:32 +0000 (15:41 +0200)]
Make skins/README looks like extensions/README file

Fixed links to mediawiki.org so pages can load on user defined
language instead of default ENGLISH.
Added == User Information == on first line as it is already in
README file for extensions directory

Change-Id: Iadc8eae48f1274d3e50e5b147565d197b1b7d3be

4 years agoUpdate OOUI to v0.31.6
Volker E [Wed, 8 May 2019 10:50:49 +0000 (03:50 -0700)]
Update OOUI to v0.31.6

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

Bug: T220792
Bug: T222088
Bug: T222427
Depends-On: Id1eae9aa3105886d557a6d11af68fff633602970
Change-Id: Ie40cf6c8eb8ad77f99512db56026827de4d636fa

4 years agoRevision history: Use `padding` for same rendering
Volker E [Wed, 8 May 2019 10:01:48 +0000 (03:01 -0700)]
Revision history: Use `padding` for same rendering

Replace `border` by `padding` to save some code while leaving
rendering unchanged. Follow-up to I71391cfd18f.

Change-Id: Ia0aa697afabbe9cdceee90805104d953468052f2

4 years agoMerge "localisation: Improve documentation around wgLocalisationCacheConf"
jenkins-bot [Tue, 7 May 2019 23:03:41 +0000 (23:03 +0000)]
Merge "localisation: Improve documentation around wgLocalisationCacheConf"

4 years agolocalisation: Improve documentation around wgLocalisationCacheConf
Timo Tijhof [Mon, 6 May 2019 21:50:38 +0000 (22:50 +0100)]
localisation: Improve documentation around wgLocalisationCacheConf

Bug: T218207
Change-Id: I15a77d5df7b358b69cd9049036a69a28d31ebaae

4 years agoSeparate Block into AbstractBlock, Block and SystemBlock
Thalia [Mon, 18 Mar 2019 22:09:49 +0000 (22:09 +0000)]
Separate Block into AbstractBlock, Block and SystemBlock

This commit splits the existing Block class into AbstractBlock, Block
and SystemBlock.

Before this patch, the Block class represents several types of
blocks, which can be separated into blocks stored in the database,
and temporary blocks created by the system. These are now
represented by Block and SystemBlock, which inherit from
AbstractBlock.

This lays the foundations for:
* enforcing block parameters from multiple blocks that apply to a
user/IP address
* improvements to the Block API, including the addition of services

Breaking changes: functions expecting a Block object should still
expect a Block object if it came from the database, but other
functions may now need to expect an AbstractBlock or SystemBlock
object. (Note that an alternative naming scheme, in which the
abstract class is called Block and the subclasses are DatabaseBlock
and SystemBlock, avoids this breakage. However, it introduces more
breakages to calls to static Block methods and new Block
instantiations.)

Changes to tests: system blocks don't set the $blockCreateAccount or
$mExipry block properties, so remove/change any tests that assume
they do.

Bug: T222737
Change-Id: I83bceb5e5049e254c90ace060f8f8fad44696c67

4 years agoMerge "Optimize WikiMap::getWikiFromUrl() for the common local wiki case"
jenkins-bot [Tue, 7 May 2019 22:30:17 +0000 (22:30 +0000)]
Merge "Optimize WikiMap::getWikiFromUrl() for the common local wiki case"

4 years agoOptimize WikiMap::getWikiFromUrl() for the common local wiki case
Aaron Schulz [Fri, 3 May 2019 22:03:50 +0000 (15:03 -0700)]
Optimize WikiMap::getWikiFromUrl() for the common local wiki case

MediaWiki::getUrlDomainDistance was showing up as taking 8-14ms in xhgui

Change-Id: I55d1c1a0e79eda9045c3487a06f5fbb967747ec6

4 years agoMerge "Temporarily skip rollback test"
jenkins-bot [Tue, 7 May 2019 21:50:52 +0000 (21:50 +0000)]
Merge "Temporarily skip rollback test"

4 years agoTemporarily skip rollback test
jdlrobson [Tue, 7 May 2019 20:47:58 +0000 (13:47 -0700)]
Temporarily skip rollback test

This test is proving flakey (seen in Minerva and MobileFrontend)
Let's skip this until we've worked out the problem.

Bug: T220479
Change-Id: I3629d4109d8e0c5c4da0c7fb0b82cf59290c0db9

4 years agoMass conversion to NamespaceInfo
Aryeh Gregor [Sun, 5 Aug 2018 17:58:51 +0000 (20:58 +0300)]
Mass conversion to NamespaceInfo

Change-Id: I2fef157ceec772f304c0923a1cd8c0eef2e82a0f

4 years agoMerge "Add AbstractBlock parent class for Block"
jenkins-bot [Tue, 7 May 2019 20:19:09 +0000 (20:19 +0000)]
Merge "Add AbstractBlock parent class for Block"

4 years agoMerge "exception: Document the three ways we listen for errors/fatals/exceptions"
jenkins-bot [Tue, 7 May 2019 20:03:58 +0000 (20:03 +0000)]
Merge "exception: Document the three ways we listen for errors/fatals/exceptions"

4 years agoMerge "selenium: Disable Minerva wdio tests"
jenkins-bot [Tue, 7 May 2019 19:55:49 +0000 (19:55 +0000)]
Merge "selenium: Disable Minerva wdio tests"

4 years agoMerge "SearchEngine: Hard deprecate SearchEngine::transformSearchTerm()"
jenkins-bot [Tue, 7 May 2019 19:51:34 +0000 (19:51 +0000)]
Merge "SearchEngine: Hard deprecate SearchEngine::transformSearchTerm()"

4 years agoMaking mediawiki.ui button mixin available for importing globally.
Jan Drewniak [Mon, 6 May 2019 22:39:48 +0000 (00:39 +0200)]
Making mediawiki.ui button mixin available for importing globally.

Moves the button color mixin into a separate file in the
mediawiki.less/mediawiki.ui folder, making it globally available
to other extensions and skins.

Initially created to make this mixin available to the Minerva skin
for use on the AMC history page on mobile.

Bug: T219895
Change-Id: I2bcf98fcd8d1b126e6d6c8746909e9921658a2b0

4 years agoMerge "Log breaking change to WatchedItemQueryServiceExtension"
Bartosz Dziewoński [Tue, 7 May 2019 18:07:48 +0000 (18:07 +0000)]
Merge "Log breaking change to WatchedItemQueryServiceExtension"

4 years agoexception: Document the three ways we listen for errors/fatals/exceptions
Timo Tijhof [Tue, 7 May 2019 17:53:03 +0000 (18:53 +0100)]
exception: Document the three ways we listen for errors/fatals/exceptions

It is now clear to me why most fatals are logged to 'exception'
on PHP 7, instead of 'fatal' (as on HHVM). It is because these
are, as of PHP 7, technically recoverable if caught locally
with 'catch (Throwable)', and as such should no longer be classified
as 'fatal'. I suppose that's fine and something we'll get used to.

The most important distinction to keep is between 'error' and 'fatal/exception'
given the latter is more heavily monitored and alerted on, but
otherwise they are not usually distingished in query, we treat
them equal for the most part.

Bug: T187147
Change-Id: I64bf0b32dd2648cf72297bdc294e315375329a4d

4 years agoMerge "Revision history: Prefer `outline` over `border` to give text more space"
jenkins-bot [Tue, 7 May 2019 17:50:28 +0000 (17:50 +0000)]
Merge "Revision history: Prefer `outline` over `border` to give text more space"

4 years agoMerge "Fix Block::newLoad for IPv6 range blocks"
jenkins-bot [Tue, 7 May 2019 17:50:21 +0000 (17:50 +0000)]
Merge "Fix Block::newLoad for IPv6 range blocks"

4 years agoLog breaking change to WatchedItemQueryServiceExtension
daniel [Tue, 7 May 2019 14:49:28 +0000 (16:49 +0200)]
Log breaking change to WatchedItemQueryServiceExtension

The WatchedItemQueryServiceExtension interface was changed
in Iadbf7bc31a49 to hint against UserIdentity instead of User.
This is a breaking change that requires extensions implementing this
interface to be updated.

This once again shows why interfaces make bad extension points, see
T193613 for discussion of the topic. There just is no good way to
make this kind of change backwards-compatible.

Bug: T222677
Change-Id: Id9625824f7dec21a5b33ebf88e6f29d2a9333541

4 years agoAdd AbstractBlock parent class for Block
Thalia [Tue, 7 May 2019 14:46:44 +0000 (09:46 -0500)]
Add AbstractBlock parent class for Block

This anticipates I83bceb5e5, which refactors Block into different
classes: Block (for blocks stored in the database), SystemBlock
(for temporary blocks), and AbstractBlock (the parent class).

Block should be become a deprecated alias of DatabaseBlock.

This adds an empty AbstractBlock parent class, and makes Block
extend AbstractBlock, but leaves it otherwise unchanged. This is
to allow typehints to be updated, to avoid a breaking change.

Bug: T222737
Change-Id: I3cf78cf77ccf492dadf53e479f81891961021469

4 years agoMerge "Obtain MessageBlobStore instance in a consistent way"
jenkins-bot [Tue, 7 May 2019 15:34:54 +0000 (15:34 +0000)]
Merge "Obtain MessageBlobStore instance in a consistent way"

4 years agoUpdate LinkRenderer to use NamespaceInfo
Aryeh Gregor [Sun, 5 Aug 2018 12:44:11 +0000 (15:44 +0300)]
Update LinkRenderer to use NamespaceInfo

Change-Id: I4af843238ffd58925f57c0f7b98253a90cb285ec

4 years agoMerge "Log warning and show error on empty username"
jenkins-bot [Tue, 7 May 2019 12:14:28 +0000 (12:14 +0000)]
Merge "Log warning and show error on empty username"

4 years agoRevision history: Prefer `outline` over `border` to give text more space
Volker E [Tue, 7 May 2019 12:11:39 +0000 (05:11 -0700)]
Revision history: Prefer `outline` over `border` to give text more space

Using `outline` enables to provide more space to selected list items'
text while not negatively impacting distance between elements.
Only browsers that are excluded by this are IE 6-7.

Change-Id: I71391cfd18f05c0fd0ea21720d278c5a06fa00a8

4 years agoMerge "Remove superfluous cast to int"
jenkins-bot [Tue, 7 May 2019 11:58:38 +0000 (11:58 +0000)]
Merge "Remove superfluous cast to int"

4 years agoMerge "Let User::idFromName always return int or null"
jenkins-bot [Tue, 7 May 2019 11:58:31 +0000 (11:58 +0000)]
Merge "Let User::idFromName always return int or null"

4 years agoMerge "SearchEngine: Hard-deprecate PrefixSearch::titleSearch()"
jenkins-bot [Tue, 7 May 2019 08:06:59 +0000 (08:06 +0000)]
Merge "SearchEngine: Hard-deprecate PrefixSearch::titleSearch()"

4 years agoMerge "filebackend: Restore TempFSFile shutdown-purge functionality"
jenkins-bot [Tue, 7 May 2019 04:58:41 +0000 (04:58 +0000)]
Merge "filebackend: Restore TempFSFile shutdown-purge functionality"

4 years agoMerge "build: Upgrade eslint-config-wikimedia 0.12.0, drop grunt-jsonlint"
jenkins-bot [Tue, 7 May 2019 01:09:53 +0000 (01:09 +0000)]
Merge "build: Upgrade eslint-config-wikimedia 0.12.0, drop grunt-jsonlint"

4 years agoObtain MessageBlobStore instance in a consistent way
Roan Kattouw [Tue, 7 May 2019 01:07:49 +0000 (18:07 -0700)]
Obtain MessageBlobStore instance in a consistent way

Use MediaWikiServices (not OutputPage) to obtain a ResourceLoader
instance, then call ->getMessageBlobStore() to obtain its
MessageBlobStore instance (don't construct a new one).

Change-Id: I6b8bacac9888b5807328eece01134a6c5747dc72

4 years agoselenium: Disable Minerva wdio tests
Timo Tijhof [Tue, 7 May 2019 00:48:50 +0000 (01:48 +0100)]
selenium: Disable Minerva wdio tests

To match the Minerva repo per I3a48ecb768a, currently
requires duplication of logic here because Quibble ignores
per-repo settings (tracked as T199116).

Bug: T222517
Change-Id: I857458c4fd9185dea03566183f40216252c533cd

4 years agoAdding mobile/desktop targets to mediawiki.action.history module
Jan Drewniak [Mon, 6 May 2019 21:06:43 +0000 (23:06 +0200)]
Adding mobile/desktop targets to mediawiki.action.history module

Bug: T219895
Change-Id: Ica9e19268762ce68a3c69cdfa8812e545658191c

4 years agobuild: Upgrade eslint-config-wikimedia 0.12.0, drop grunt-jsonlint
James D. Forrester [Mon, 6 May 2019 20:48:40 +0000 (13:48 -0700)]
build: Upgrade eslint-config-wikimedia 0.12.0, drop grunt-jsonlint

Bug: T220036
Change-Id: I7088f9eeb9468b14efb2773fde5f55fd5c95a489

4 years agoMerge "Consolidate duplicated unseen change logic and fix inconsistent code"
jenkins-bot [Mon, 6 May 2019 19:59:46 +0000 (19:59 +0000)]
Merge "Consolidate duplicated unseen change logic and fix inconsistent code"

4 years agoLog warning and show error on empty username
Aryeh Gregor [Mon, 6 May 2019 08:58:09 +0000 (11:58 +0300)]
Log warning and show error on empty username

Historically it seems that if Linker::userLink or friends were passed an
empty username (probably due to an incorrect database entry), they would
produce bogus output, e.g., an <a> with no contents or a link to the
invalid page "User_talk:" or similar.

In b6e1e99bec8d we replaced an occurrence of Title::makeTitle() (no
safety checks!) with creating a TitleValue, which asserts in its
constructor that the title text is not empty. This made such pages fail
an assertion and stop displaying at all.

Now there's a proper check for the error. Such cases will log a
production error and return "(no username available)".

Bug: T222529
Change-Id: Id65bdf9666b0d16e5553b8f38c7cf8fce2e37a25

4 years agoMerge "Convert WatchedItem and friends to LinkTarget"
jenkins-bot [Mon, 6 May 2019 19:33:44 +0000 (19:33 +0000)]
Merge "Convert WatchedItem and friends to LinkTarget"

4 years agoMerge "Move Title::getSubject/Talk/OtherPage to NamespaceInfo"
jenkins-bot [Mon, 6 May 2019 19:33:37 +0000 (19:33 +0000)]
Merge "Move Title::getSubject/Talk/OtherPage to NamespaceInfo"

4 years agotests: Remove use of wfRandomString() for test fixtures
Timo Tijhof [Sat, 4 May 2019 20:41:10 +0000 (21:41 +0100)]
tests: Remove use of wfRandomString() for test fixtures

This reduces confidence in the test. There is no guruantee that
it won't return the same value twice during the duration of a full
PHPUnit run of all test suites, whether twice in a row or 20 minutes
apart.

For a test that needs a string of any kind, use an explicit, consinstent
and cheap literal value.

For a test that specifically needs some kind of uniqueness compared to
something else within the same test case, do so explicitly.

Tests that require something globally unique (for some undefined/vague
definition of "global") were not found, and should not exist anyway.

Also, in libs/objectcache tests, fix order of parameters in some
assertions (expected first, then actual), and use assertFalse/assertSame
instead of assertEqual for cases where false is expected to remove
tolerance of other loosely equal values.

Change-Id: Ifc60e88178da471330b94bfbf12e2731d2efc77d

4 years agotests: Use standard utilities for temporary file names
Timo Tijhof [Sat, 4 May 2019 20:32:51 +0000 (21:32 +0100)]
tests: Use standard utilities for temporary file names

Change-Id: Iff28c27990a81b02a92148a88256b9a25518f496

4 years agoMerge "Update LinkCache to use NamespaceInfo"
jenkins-bot [Mon, 6 May 2019 16:48:20 +0000 (16:48 +0000)]
Merge "Update LinkCache to use NamespaceInfo"

4 years agoMerge "tests: Avoid namespace slashes in getNewTempFile() utility"
jenkins-bot [Mon, 6 May 2019 16:22:32 +0000 (16:22 +0000)]
Merge "tests: Avoid namespace slashes in getNewTempFile() utility"

4 years agoSearchEngine: Hard-deprecate PrefixSearch::titleSearch()
Derick Alangi [Mon, 6 May 2019 14:32:04 +0000 (15:32 +0100)]
SearchEngine: Hard-deprecate PrefixSearch::titleSearch()

Usage
=====

https://codesearch.wmflabs.org/search/?q=%5B%5E%3E%5D(-%3E%7C%3A%3A)titleSearch&i=nope&files=&repos=

Only the MassEditRegex extension uses this method per the search,
so hard deprecating this method.

Change-Id: Ia10caacd3cde94f08e59f5f8d7e90f61c7de604e

4 years agoConvert WatchedItem and friends to LinkTarget
Aryeh Gregor [Mon, 29 Apr 2019 17:25:13 +0000 (20:25 +0300)]
Convert WatchedItem and friends to LinkTarget

There is no longer any reference to Title in WatchedItem classes or
their unit tests except for one hook that keeps Title for compat. Happy
side effects include getting rid of $revisionGetTimestampFromIdCallback,
and a net reduction of 143 LOC.

Change-Id: Id998c6f336ed808f7259e4f8359bcf8d6c0210d6

4 years agoMove Title::getSubject/Talk/OtherPage to NamespaceInfo
Aryeh Gregor [Mon, 29 Apr 2019 16:29:31 +0000 (19:29 +0300)]
Move Title::getSubject/Talk/OtherPage to NamespaceInfo

This allows converting some more code to LinkTarget. 100% test coverage.

Change-Id: I28903af6a41d02755f37f31561a524547445821e

4 years agoMerge "Force user id and actor id to 0 when loading from remote wikis"
jenkins-bot [Mon, 6 May 2019 15:19:38 +0000 (15:19 +0000)]
Merge "Force user id and actor id to 0 when loading from remote wikis"

4 years agoForce user id and actor id to 0 when loading from remote wikis
Bill Pirkle [Fri, 3 May 2019 01:57:40 +0000 (20:57 -0500)]
Force user id and actor id to 0 when loading from remote wikis

Stop-gap solution for the problem described in T222212.
Force the User ID and Actor ID to zero for users loaded
from the database of another wiki, to prevent subtle data
corruption and confusing failure modes.

Bug: T222381
Change-Id: Ic585f972d61da136744d080df13d8eb1ecd04cf5

4 years agoMerge "Make RepoGroup a service instead of singleton"
jenkins-bot [Mon, 6 May 2019 12:51:46 +0000 (12:51 +0000)]
Merge "Make RepoGroup a service instead of singleton"

4 years agoMerge "100% test coverage for NamespaceInfo"
jenkins-bot [Mon, 6 May 2019 12:32:17 +0000 (12:32 +0000)]
Merge "100% test coverage for NamespaceInfo"

4 years agoMerge "Move ApiQueryUserInfo::getBlockInfo() to ApiBase"
jenkins-bot [Mon, 6 May 2019 12:29:40 +0000 (12:29 +0000)]
Merge "Move ApiQueryUserInfo::getBlockInfo() to ApiBase"

4 years agoMerge "rcfeed: Replace usage of deprecated class RCFeedEngine (in comments)"
jenkins-bot [Mon, 6 May 2019 11:43:00 +0000 (11:43 +0000)]
Merge "rcfeed: Replace usage of deprecated class RCFeedEngine (in comments)"

4 years agoMerge "NS_MEDIA also always has page_id 0"
jenkins-bot [Mon, 6 May 2019 11:39:14 +0000 (11:39 +0000)]
Merge "NS_MEDIA also always has page_id 0"

4 years ago100% test coverage for NamespaceInfo
Aryeh Gregor [Tue, 30 Apr 2019 15:13:58 +0000 (18:13 +0300)]
100% test coverage for NamespaceInfo

In the new tests I added, I tried to cover all interesting scenarios and
not just hit each line to make the coverage green. But I didn't review
all the existing tests to see if they were properly thorough, so there
might still be room for improvement.

I uncovered a bug here that will be addressed in a separate commit,
because the fix is not so simple. For now I left the test expectation as
a @todo.

Change-Id: I33d556bf83c631a8a02a6c77f2f5cb06b8dbf869

4 years agoMake RepoGroup a service instead of singleton
Aryeh Gregor [Wed, 1 May 2019 12:54:54 +0000 (15:54 +0300)]
Make RepoGroup a service instead of singleton

Change-Id: Id1661bf992ee7b7a1822f52fdfefe8e045b9f280

4 years agoMerge "MovePage methods need to run safety checks"
jenkins-bot [Mon, 6 May 2019 10:51:40 +0000 (10:51 +0000)]
Merge "MovePage methods need to run safety checks"

4 years agoMerge "Don't pass Config to NamespaceInfo"
jenkins-bot [Mon, 6 May 2019 10:51:34 +0000 (10:51 +0000)]
Merge "Don't pass Config to NamespaceInfo"

4 years agoMerge "Update GenderCache to use NamespaceInfo"
jenkins-bot [Mon, 6 May 2019 10:45:15 +0000 (10:45 +0000)]
Merge "Update GenderCache to use NamespaceInfo"

4 years agoMerge "Deprecate the Http class"
jenkins-bot [Mon, 6 May 2019 10:15:10 +0000 (10:15 +0000)]
Merge "Deprecate the Http class"

4 years agoMerge "Update DefaultPreferencesFactory to use NamespaceInfo"
jenkins-bot [Mon, 6 May 2019 09:53:57 +0000 (09:53 +0000)]
Merge "Update DefaultPreferencesFactory to use NamespaceInfo"

4 years agoUpdate LinkCache to use NamespaceInfo
Aryeh Gregor [Tue, 9 Apr 2019 09:30:58 +0000 (12:30 +0300)]
Update LinkCache to use NamespaceInfo

Change-Id: Ie9ebc2564861068dea8a64aea5cbeacb03597cea

4 years agoUpdate DefaultPreferencesFactory to use NamespaceInfo
Aryeh Gregor [Sun, 5 Aug 2018 12:56:23 +0000 (15:56 +0300)]
Update DefaultPreferencesFactory to use NamespaceInfo

Depends-On: I552264714de7227965f978f20f932f41cf96042e
Change-Id: I0568e7f4c7223208001f378a03fef395df8bff69

4 years agoMerge "Improve rollback tests setup by extracting repeating logic to HistoryPage...
jenkins-bot [Mon, 6 May 2019 09:09:08 +0000 (09:09 +0000)]
Merge "Improve rollback tests setup by extracting repeating logic to HistoryPage object"

4 years agoUpdate GenderCache to use NamespaceInfo
Aryeh Gregor [Sun, 5 Aug 2018 10:05:44 +0000 (13:05 +0300)]
Update GenderCache to use NamespaceInfo

Change-Id: I0c2997bf8764249c26251d0f63f3ea0a0b272a7e

4 years agoDeprecate the Http class
Aryeh Gregor [Mon, 15 Apr 2019 13:23:02 +0000 (16:23 +0300)]
Deprecate the Http class

All methods got moved to HttpRequestFactory or MWHttpRequest or dropped.

I made the return value of the new HttpRequestFactory::request/get/post
methods null on error instead of false, so that when we drop PHP 7
support, we can use a "?string" return value. This could theoretically
change behavior of code that was switched from the old Http methods, but
probably won't. I kept the old behavior for the deprecated methods.

I changed the default value of $wgHTTPProxy from false to ''. This way
it should be usable directly without a trivial wrapper method. For the
benefit of anyone who might have set it to false in LocalSettings.php, I
also recommend casting to string just in case.

Http::$httpEngine is deprecated. Eventually it will be removed along
with the curl and PHP engines, leaving only the Guzlle engine.

I also added deprecation of MWHttpRequest::factory, which occurred in
1.31, to the release notes for 1.34. Now hopefully we can hard-deprecate
it in another couple of versions.

Bug: T214390
Change-Id: I2a316a758d793857f248bd251b90f5e9a6440e3a

4 years agoDon't pass Config to NamespaceInfo
Aryeh Gregor [Fri, 12 Apr 2019 09:49:59 +0000 (12:49 +0300)]
Don't pass Config to NamespaceInfo

Change-Id: Ie43e6108c6b9bcb666b1dece055e0df689e2ec42

4 years agoMovePage methods need to run safety checks
Aryeh Gregor [Tue, 16 Apr 2019 12:37:41 +0000 (15:37 +0300)]
MovePage methods need to run safety checks

A move method that doesn't check for things like moving a page on top of
itself or moving to a namespace with a different content model does not
seem like it's what callers would expect, and not what Title::moveTo
ever did. If there's a caller that really wants this behavior, we can
make moveUnsafe public.

I also made the $reason and $createRedirect parameters to move()
optional to match Title::moveTo() behavior. However, I made $reason
default to null instead of '', to distinguish between an empty edit
reason provided by the user and no edit reason provided at all (e.g., a
move done internally without specific user request).

Depends-On: I971e619eb76c4474fe037fad258f9c496717bf41
Change-Id: I6ddcc9f34a48f997ae39b79cd2df40dd2cc10197

4 years agoMove ApiQueryUserInfo::getBlockInfo() to ApiBase
Amir Sarabadani [Mon, 29 Apr 2019 07:47:31 +0000 (09:47 +0200)]
Move ApiQueryUserInfo::getBlockInfo() to ApiBase

ApiBase directly uses this method causing a cyclic dependency between
ApiBase and ApiQueryUserInfo

Change-Id: I84ed21641c44b2f65ebe1980b0893d1846db3b34

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 5 May 2019 19:54:56 +0000 (21:54 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I7fb884c03375b5c918f8e4b7f5309bbbe70c89ad

4 years agoMerge "Permissions: Declare the $nsInfo property and document it in constructor"
jenkins-bot [Sun, 5 May 2019 19:35:38 +0000 (19:35 +0000)]
Merge "Permissions: Declare the $nsInfo property and document it in constructor"

4 years agoMove getPrevious/NextRevision logic out of Title
Aryeh Gregor [Mon, 29 Apr 2019 14:24:58 +0000 (17:24 +0300)]
Move getPrevious/NextRevision logic out of Title

They belong in RevisionStore. This change removes the dependency on
Title for these methods and will assist in porting more code to
LinkTarget.

At the same time, deprecate the Title parameter to
RevisionLookup/RevisionStore getPreviousRevision/getNextRevision, and
add a $flags parameter to match the functionality of the Title versions.
Since code search turned up no callers that passed a Title outside core,
this variant is immediately hard-deprecated. The Title methods
themselves are only soft-deprecated.

Change-Id: I76bc6fd6ee1a9f35b5f29fa640824fb5da3bb78e

4 years agoPermissions: Declare the $nsInfo property and document it in constructor
Derick Alangi [Sun, 5 May 2019 15:43:42 +0000 (16:43 +0100)]
Permissions: Declare the $nsInfo property and document it in constructor

Was added in commit 1f7ab9c but was never documented nor declared before its
usage.

Change-Id: Iea833f9ffb6ac210251912d35cdebf9bb064d610

4 years agoDon't require Title for getTimestampFromId
Aryeh Gregor [Mon, 29 Apr 2019 14:32:22 +0000 (17:32 +0300)]
Don't require Title for getTimestampFromId

3e36ba655e3a added an option for passing a page ID to this method of
Revision, and e03787afd91c switched it to a Title and made it mandatory.
This behavior propagated to the method in RevisionStore.  As far as I
can tell, the parameter does not help anything, but it can add a
database query to get the page ID if it's not cached, and impedes
conversion to LinkTarget. I can't figure out any reason to not
completely drop it. I've noted it as deprecated but still supported it
for now for compatibility -- I found one extension that does pass it.
(It's ignored, though, which theoretically would be a behavior change if
someone was passing a Title that didn't match the revision ID.)

While I was at it, I added the method to RevisionLookup, although it's
only used in later patches. Properly I should move that piece to a later
patch, but it didn't seem worth the effort.

I didn't change the Revision method, because the whole Revision class is
deprecated anyway.

Change-Id: I26ef5f2bf828f0f450633b7237d26d888e2c8773

4 years agoConvert WatchedItem and friends to UserIdentity
Aryeh Gregor [Sun, 28 Apr 2019 11:07:18 +0000 (14:07 +0300)]
Convert WatchedItem and friends to UserIdentity

I wasn't able to port some places that rely on isAllowed, getOption, or
related methods.

This adds isRegistered() to UserIdentity, which works like
User::isLoggedIn() but with a better name.

I also cleaned up User mocks in WatchedItemQueryServiceUnitTest in the
course of debugging test failures when switching them to
UserIdentityValue instead of mock Users where possible. They now specify
explicitly which methods are allowed to be called on their User objects,
which I believe is good practice for mocks (and unfortunately PHPUnit
makes it awkward).

Bug: T207972
Depends-On: I883d506197a011fe4c102b72df4d9deb58ab5ca2
Change-Id: Iadbf7bc31a496899dbef44e49065ff89f37aea89

4 years agoNS_MEDIA also always has page_id 0
Aryeh Gregor [Sun, 5 May 2019 08:37:01 +0000 (11:37 +0300)]
NS_MEDIA also always has page_id 0

Change-Id: I0047e5f8e367fe3e8433e715ea56616a6f8dab85

4 years agotests: Avoid namespace slashes in getNewTempFile() utility
Timo Tijhof [Sat, 4 May 2019 21:52:00 +0000 (22:52 +0100)]
tests: Avoid namespace slashes in getNewTempFile() utility

This will make things easier to reason about.

I'm hoping this will fix the issue that (unmerged) Iff28c27990 is
triggering in WikibaseMediaInfo tests.

Change-Id: I7eb4a8c6bf6f6f7103190b9f225579176a7440d6

4 years agofilebackend: Restore TempFSFile shutdown-purge functionality
Timo Tijhof [Sat, 4 May 2019 20:04:58 +0000 (21:04 +0100)]
filebackend: Restore TempFSFile shutdown-purge functionality

Introduced in 603d8970c3575 to handle purging of tmp files
in case of fatals and other ways that the PHP process can exit
in a way that (some) destructors might not run, but shutdown
callbacks do.

It did not appear to work as it looped over the array values,
which are all int(1), instead of the array keys.

Change-Id: I83f0c8ea15e2bfb2bdc9aa2b4015635771abe394

4 years agoMerge "Add UserOptionsUpdateJob class"
jenkins-bot [Sat, 4 May 2019 17:42:48 +0000 (17:42 +0000)]
Merge "Add UserOptionsUpdateJob class"

4 years agoMerge "Mock IDatabase::class instead of DatabaseMysqli::class"
jenkins-bot [Fri, 3 May 2019 23:36:11 +0000 (23:36 +0000)]
Merge "Mock IDatabase::class instead of DatabaseMysqli::class"

4 years agoConsolidate duplicated unseen change logic and fix inconsistent code
Aaron Schulz [Fri, 3 May 2019 20:23:24 +0000 (13:23 -0700)]
Consolidate duplicated unseen change logic and fix inconsistent code

Bug: T218511
Change-Id: I42387498dff0b1fc31f006ce3ba71241de9d45d7

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 3 May 2019 20:00:03 +0000 (22:00 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Iaffb949f59706ee6ca0d61ca8a3c9487be0d5a31

4 years agoMerge "Avoid/Replace usage of deprecated `wfMemcKey()` function"
jenkins-bot [Fri, 3 May 2019 19:27:23 +0000 (19:27 +0000)]
Merge "Avoid/Replace usage of deprecated `wfMemcKey()` function"

4 years agoAdd UserOptionsUpdateJob class
Aaron Schulz [Fri, 29 Mar 2019 07:17:09 +0000 (00:17 -0700)]
Add UserOptionsUpdateJob class

This can help avoid DB master queries on HTTP GET requests

Change-Id: I6fa2d53d96509d88f5d3e1ff18f3ca1de8fa4bb1

4 years agoMerge "generatePhpCharToUpperMappings.php: Write output directly to json file"
jenkins-bot [Fri, 3 May 2019 18:23:06 +0000 (18:23 +0000)]
Merge "generatePhpCharToUpperMappings.php: Write output directly to json file"

4 years agoMerge "HTMLForm: Improve method interface for collapsible forms"
jenkins-bot [Fri, 3 May 2019 17:22:43 +0000 (17:22 +0000)]
Merge "HTMLForm: Improve method interface for collapsible forms"

4 years agoMerge "Make JSON styling available on mobile"
jenkins-bot [Fri, 3 May 2019 17:00:10 +0000 (17:00 +0000)]
Merge "Make JSON styling available on mobile"

4 years agoMake JSON styling available on mobile
Ed Sanders [Fri, 12 Apr 2019 14:23:59 +0000 (15:23 +0100)]
Make JSON styling available on mobile

Styling works fine on mobile and is only loaded
on JSON pages. Without the styling the page is
much harder to read.

Change-Id: I68a7a02f42ec4352969d6e24ba7b0b1f85374523

4 years agoRemove parameter 'options' from hook 'SkinEditSectionLinks'
Fomafix [Tue, 30 Apr 2019 10:19:51 +0000 (12:19 +0200)]
Remove parameter 'options' from hook 'SkinEditSectionLinks'

The generated links are now always known links.

All users of the hook 'SkinEditSectionLinks' in extensions set
'options' => [ 'noclasses', 'known' ]
https://gerrit.wikimedia.org/g/mediawiki/extensions/TinyMCE/+/5f48eb9acd19062a5d6e731ef34b93ef62d3e730/TinyMCE.hooks.php#291
https://gerrit.wikimedia.org/g/mediawiki/extensions/VisualEditor/+/857c1bd3d14ce3a2a98a7d9743fc6120f7d91e9e/includes/VisualEditorHooks.php#617

This change makes it easier to migrate to LinkRenderer in
Ifc170abc958add28a2fe08aa0c44af83c6f7cad8 without legacy options.

Change-Id: Ia5d151b81dabce9560045b45886f2c77abf975da