lhc/web/wiklou.git
5 years agoLocalisationCache: Avoid use of compact()
Kunal Mehta [Mon, 15 Oct 2018 07:17:38 +0000 (00:17 -0700)]
LocalisationCache: Avoid use of compact()

In PHP 7.3, compact() now raises notices if the variable is undefined, which
is something that we expect. So we can check whether the key exists instead
of bothering with compat() and suppressing warnings.

Bug: T206979
Change-Id: I612049db4debd850a2e6d10bc631d31aa17be898

5 years agodocs: Remove outdated information from globals.txt
MGChecker [Sun, 14 Oct 2018 18:28:54 +0000 (20:28 +0200)]
docs: Remove outdated information from globals.txt

design.txt doesn't exist anymore.

Bug: T111283
Change-Id: Ibb67fb721060b325114e571ba3e470a607d98884

5 years agoMerge "jobqueue: clean up JobQueueDB::getCacheKey() to use makeGlobalKey()"
jenkins-bot [Sat, 13 Oct 2018 23:59:35 +0000 (23:59 +0000)]
Merge "jobqueue: clean up JobQueueDB::getCacheKey() to use makeGlobalKey()"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 13 Oct 2018 07:49:22 +0000 (09:49 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I5958a3381bd070c1cb7d79e6819b638418b87165

5 years agojobqueue: clean up JobQueueDB::getCacheKey() to use makeGlobalKey()
Aaron Schulz [Sat, 13 Oct 2018 07:14:38 +0000 (00:14 -0700)]
jobqueue: clean up JobQueueDB::getCacheKey() to use makeGlobalKey()

Change-Id: I341720fda0d242c7822f78048cb49f63538d08bc

5 years agotravis: Remove PHP 7.2 from allowed failures
Kunal Mehta [Sat, 13 Oct 2018 06:47:42 +0000 (23:47 -0700)]
travis: Remove PHP 7.2 from allowed failures

It's now passing!

Bug: T204884
Change-Id: Idb17630cff54b803ca5fa942b2fcf17a775edd0d

5 years agoMerge "Output only to stderr in unit tests"
jenkins-bot [Sat, 13 Oct 2018 06:29:17 +0000 (06:29 +0000)]
Merge "Output only to stderr in unit tests"

5 years agoMerge "SlotDiffRenderer: add utility method for parameter type checks"
jenkins-bot [Sat, 13 Oct 2018 05:27:16 +0000 (05:27 +0000)]
Merge "SlotDiffRenderer: add utility method for parameter type checks"

5 years agoMerge "Linker: Document parseComment() as returning HTML"
jenkins-bot [Sat, 13 Oct 2018 05:23:43 +0000 (05:23 +0000)]
Merge "Linker: Document parseComment() as returning HTML"

5 years agoMerge "Log startAtomic()/endAtomic() to the query logger"
jenkins-bot [Sat, 13 Oct 2018 01:45:09 +0000 (01:45 +0000)]
Merge "Log startAtomic()/endAtomic() to the query logger"

5 years agoLog startAtomic()/endAtomic() to the query logger
Tim Starling [Wed, 10 Oct 2018 04:03:21 +0000 (15:03 +1100)]
Log startAtomic()/endAtomic() to the query logger

Change-Id: Ife7e292ef42946ec1c5e9121b7be6a90301b3903

5 years agoMerge "exception: Correct label "Notice" for E_USER_NOTICE, not "Warning""
jenkins-bot [Sat, 13 Oct 2018 00:58:16 +0000 (00:58 +0000)]
Merge "exception: Correct label "Notice" for E_USER_NOTICE, not "Warning""

5 years agoMerge "Revert "rdbms: add domain sanity checks to LoadBalancer connection methods""
jenkins-bot [Sat, 13 Oct 2018 00:58:11 +0000 (00:58 +0000)]
Merge "Revert "rdbms: add domain sanity checks to LoadBalancer connection methods""

5 years agoRevert "rdbms: add domain sanity checks to LoadBalancer connection methods"
Krinkle [Sat, 13 Oct 2018 00:35:55 +0000 (00:35 +0000)]
Revert "rdbms: add domain sanity checks to LoadBalancer connection methods"

This reverts commit b416e166a3eba1dcfc2e912e37e443981d7f60ef.

Fails on Travis CI / PHP 7.1 / Postgres:

> Creating administrator user account
>
> UnexpectedValueException:
> Got connection to 'traviswiki-mediawiki', but expected 'traviswiki'.
>
> Backtrace:
> #0 includes/libs/rdbms/loadbalancer/LoadBalancer.php(887): Wikimedia\Rdbms\LoadBalancer->openForeignConnection(integer, string, integer)
> #1 includes/libs/rdbms/loadbalancer/LoadBalancer.php(766): Wikimedia\Rdbms\LoadBalancer->openConnection(integer, string, integer)
> #2 includes/libs/rdbms/loadbalancer/LoadBalancer.php(851): Wikimedia\Rdbms\LoadBalancer->getConnection(integer, array, string, integer)
> #3 includes/jobqueue/JobQueueDB.php(780): Wikimedia\Rdbms\LoadBalancer->getConnectionRef(integer, array, string, integer)
> #4 includes/jobqueue/JobQueueDB.php(761): JobQueueDB->getDB(integer)
> #5 includes/jobqueue/JobQueueDB.php(187): JobQueueDB->getMasterDB()
> #6 includes/jobqueue/JobQueue.php(332): JobQueueDB->doBatchPush(array, integer)
> #7 includes/jobqueue/JobQueue.php(302): JobQueue->batchPush(array, integer)
> #8 includes/jobqueue/JobQueueGroup.php(154): JobQueue->push(array)
> #9 includes/user/UserGroupMembership.php(162): JobQueueGroup->push(array)
> #10 includes/user/User.php(3733): UserGroupMembership->insert(boolean)
> #11 includes/installer/Installer.php(1680): User->addGroup(string)
> #12 includes/installer/Installer.php(1601): Installer->createSysop(PostgresInstaller)
> #13 includes/installer/CliInstaller.php(176): Installer->performInstallation(array, array)

Change-Id: I269df89d47cc5a183af630447cd1642d3d4a3deb

5 years agoMerge "rdbms: add domain sanity checks to LoadBalancer connection methods"
Krinkle [Sat, 13 Oct 2018 00:08:28 +0000 (00:08 +0000)]
Merge "rdbms: add domain sanity checks to LoadBalancer connection methods"

5 years agoMerge "Avoid global $wgUpdateRowsPerQuery in WatchedItemStore"
jenkins-bot [Fri, 12 Oct 2018 22:35:49 +0000 (22:35 +0000)]
Merge "Avoid global $wgUpdateRowsPerQuery in WatchedItemStore"

5 years agoMerge "Add OOUI for HTMLFormFieldCloner"
jenkins-bot [Fri, 12 Oct 2018 22:30:59 +0000 (22:30 +0000)]
Merge "Add OOUI for HTMLFormFieldCloner"

5 years agoLinker: Document parseComment() as returning HTML
Roan Kattouw [Fri, 12 Oct 2018 22:18:03 +0000 (15:18 -0700)]
Linker: Document parseComment() as returning HTML

It's not entirely clear from the documentation whether this method
returns wikitext or HTML, so make it explicit.

Change-Id: I094e370e921c43dd8c5dc4376b3dddd803665d90

5 years agoMerge "Pass LBFactory to WatchedItemStore"
jenkins-bot [Fri, 12 Oct 2018 21:48:54 +0000 (21:48 +0000)]
Merge "Pass LBFactory to WatchedItemStore"

5 years agoMerge "HtmlTest: Perform multilingual tests"
jenkins-bot [Fri, 12 Oct 2018 18:59:28 +0000 (18:59 +0000)]
Merge "HtmlTest: Perform multilingual tests"

5 years agoMerge "Use a ScopedCallback to silence transaction profiler in SqlBagOStuff"
jenkins-bot [Fri, 12 Oct 2018 18:34:02 +0000 (18:34 +0000)]
Merge "Use a ScopedCallback to silence transaction profiler in SqlBagOStuff"

5 years agoHtmlTest: Perform multilingual tests
Erik Bernhardson [Fri, 12 Oct 2018 18:23:02 +0000 (11:23 -0700)]
HtmlTest: Perform multilingual tests

The tests here were only testing when user and content language
are the same, but the way things are rendered when they differ
is perhaps more interesting as it allows ensuring the two are used
in the correct places.

Change-Id: I357f50b082882fee485a95323d3a0a7cadb9a63c

5 years agoUse a ScopedCallback to silence transaction profiler in SqlBagOStuff
Umherirrender [Sat, 22 Sep 2018 12:38:02 +0000 (14:38 +0200)]
Use a ScopedCallback to silence transaction profiler in SqlBagOStuff

This affects most LCStoreDB which is the default cache
and spamming the log.

Bug: T154424
Bug: T97693
Change-Id: I68af177c7d0d88ab266eb3fefb4336eff86d861c

5 years agoDeprecate $wgUseKeyHeader and OutputPage::getKeyHeader()
C. Scott Ananian [Fri, 12 Oct 2018 15:50:14 +0000 (11:50 -0400)]
Deprecate $wgUseKeyHeader and OutputPage::getKeyHeader()

The `Key` header was a draft IETF specification which expired without
becoming a standard.  It does not appear to be in active use anywhere.

Change-Id: I3924a1b5ff428b107573d2827c40e4af8adaaeb1

5 years agoAvoid global $wgUpdateRowsPerQuery in WatchedItemStore
Umherirrender [Thu, 11 Oct 2018 19:13:35 +0000 (21:13 +0200)]
Avoid global $wgUpdateRowsPerQuery in WatchedItemStore

Change-Id: Ibff69d16919a595c3edb8e2b431aa42d84a2777a

5 years agoPass LBFactory to WatchedItemStore
Umherirrender [Thu, 11 Oct 2018 19:11:43 +0000 (21:11 +0200)]
Pass LBFactory to WatchedItemStore

Instead of passing the LoadBalancer and than get the LBFactory from the
service,
store the LBFactory on creation

Bug: T206601
Change-Id: I4c0d3712da591b2c5ddf2a65855d2cc9142417d2

5 years agoexception: Correct label "Notice" for E_USER_NOTICE, not "Warning"
Timo Tijhof [Fri, 12 Oct 2018 04:05:16 +0000 (05:05 +0100)]
exception: Correct label "Notice" for E_USER_NOTICE, not "Warning"

Follows-up ef06b528d9, which fixed the severity of all PHP errors
to have severity "Warning" or higher.

However, it also accidentally changed the label of "Notice"
to "Warning", which is confusing and incorrect.

Change-Id: Iffd39aa23b7f2cbff5cdaf876b8d4d595dcd6f96

5 years agordbms: add domain sanity checks to LoadBalancer connection methods
Aaron Schulz [Wed, 15 Aug 2018 02:24:37 +0000 (19:24 -0700)]
rdbms: add domain sanity checks to LoadBalancer connection methods

Bug: T193565
Change-Id: I94d905277e01b8e30ac3f6532ece07388bb20cce

5 years agoMerge "Make MergeableUpdate jobs avoid the sub-queue so they can always merge"
jenkins-bot [Fri, 12 Oct 2018 01:13:29 +0000 (01:13 +0000)]
Merge "Make MergeableUpdate jobs avoid the sub-queue so they can always merge"

5 years agoMerge "Make merged MergeableUpdate items always go to the end of the queue"
jenkins-bot [Fri, 12 Oct 2018 00:58:59 +0000 (00:58 +0000)]
Merge "Make merged MergeableUpdate items always go to the end of the queue"

5 years agoMerge "Fix Setup.php file-scope test"
jenkins-bot [Fri, 12 Oct 2018 00:58:54 +0000 (00:58 +0000)]
Merge "Fix Setup.php file-scope test"

5 years agoMake MergeableUpdate jobs avoid the sub-queue so they can always merge
Aaron Schulz [Thu, 11 Oct 2018 22:11:50 +0000 (15:11 -0700)]
Make MergeableUpdate jobs avoid the sub-queue so they can always merge

Change-Id: I5b100fae29b785ab4524d165dad2e8ee46406b0c

5 years agoIncrease OutputPage test coverage to >45%
Aryeh Gregor [Thu, 2 Aug 2018 18:42:17 +0000 (21:42 +0300)]
Increase OutputPage test coverage to >45%

Also stop returning a value from OutputPage::adaptCdnTTL().  There are
no users and the value doesn't seem very helpful: one would probably
expect it to return the new value of mCdnMaxage, but instead it
returns the new value of mCdnMaxageLimit. Better to have no return
value than one that's easily misunderstood (*and* which nobody uses).

Change-Id: Ia9dab86923b839334eab9f6fde17c4aed52130ec

5 years agoMerge "Add join conditions to ActiveUsersPager"
jenkins-bot [Thu, 11 Oct 2018 22:11:53 +0000 (22:11 +0000)]
Merge "Add join conditions to ActiveUsersPager"

5 years agoMerge "resourceloader: Throw exception when config serialization fails"
jenkins-bot [Thu, 11 Oct 2018 22:11:47 +0000 (22:11 +0000)]
Merge "resourceloader: Throw exception when config serialization fails"

5 years agoMake merged MergeableUpdate items always go to the end of the queue
Aaron Schulz [Thu, 11 Oct 2018 21:51:36 +0000 (14:51 -0700)]
Make merged MergeableUpdate items always go to the end of the queue

Change-Id: I2e8aa28f7426470d9b8b9e11b902deea793069b3

5 years agoresourceloader: Throw exception when config serialization fails
Roan Kattouw [Tue, 9 Oct 2018 20:43:56 +0000 (13:43 -0700)]
resourceloader: Throw exception when config serialization fails

If something puts a string that's invalid UTF-8 in a JS config variable,
JSON serialization will fail on the entire config blob. Currently, this
causes the entire config blob to be silently dropped, which breaks all
JavaScript because elementary variables like wgPageName are missing.

This change makes this scenario fail loudly rather than quietly, by
throwing an exception. This also makes bugs like these easier to track
down.

Bug: T206475
Change-Id: Ief2ae00228389a23627d440dc1cd9a54cf2b6926

5 years agoMerge "MessageCache: replace should actually replace, not reload"
jenkins-bot [Thu, 11 Oct 2018 20:56:33 +0000 (20:56 +0000)]
Merge "MessageCache: replace should actually replace, not reload"

5 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Thu, 11 Oct 2018 20:46:47 +0000 (20:46 +0000)]
Merge "Localisation updates from https://translatewiki.net."

5 years agoMerge "Accept BCP 47 codes as aliases for nonstandard variants"
jenkins-bot [Thu, 11 Oct 2018 20:46:42 +0000 (20:46 +0000)]
Merge "Accept BCP 47 codes as aliases for nonstandard variants"

5 years agoMerge "Ensure LanguageCode::bcp47() returns a valid BCP 47 language code"
jenkins-bot [Thu, 11 Oct 2018 20:46:35 +0000 (20:46 +0000)]
Merge "Ensure LanguageCode::bcp47() returns a valid BCP 47 language code"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 11 Oct 2018 20:14:07 +0000 (22:14 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I17af87ea492359cd0c09dc3c62af8caa8755368a

5 years agoSplit out getSlotParserOutputUncached() method for the sake of profiling
Aaron Schulz [Thu, 11 Oct 2018 17:39:05 +0000 (10:39 -0700)]
Split out getSlotParserOutputUncached() method for the sake of profiling

Change-Id: I553dba13486982b4530d290c84dc1f53b4df6ff9

5 years agoMerge "Allow and use type Language instead of string for $lang of doEditSectionLink"
jenkins-bot [Thu, 11 Oct 2018 19:52:13 +0000 (19:52 +0000)]
Merge "Allow and use type Language instead of string for $lang of doEditSectionLink"

5 years agoMerge ".mailmap: Add a few new entries"
jenkins-bot [Thu, 11 Oct 2018 19:52:02 +0000 (19:52 +0000)]
Merge ".mailmap: Add a few new entries"

5 years agoMerge "Drop ParserLimitReport, deprecated in 1.22"
jenkins-bot [Thu, 11 Oct 2018 19:47:10 +0000 (19:47 +0000)]
Merge "Drop ParserLimitReport, deprecated in 1.22"

5 years agoMerge "Drop UnknownAction, deprecated in 1.19(!)"
jenkins-bot [Thu, 11 Oct 2018 19:44:16 +0000 (19:44 +0000)]
Merge "Drop UnknownAction, deprecated in 1.19(!)"

5 years agoMerge "Drop wfRunHooks, deprecated since 1.25"
jenkins-bot [Thu, 11 Oct 2018 19:41:18 +0000 (19:41 +0000)]
Merge "Drop wfRunHooks, deprecated since 1.25"

5 years agoMerge "Drop UserGetImplictGroups, deprecated since 1.25"
jenkins-bot [Thu, 11 Oct 2018 19:41:13 +0000 (19:41 +0000)]
Merge "Drop UserGetImplictGroups, deprecated since 1.25"

5 years agoAdd join conditions to ActiveUsersPager
Brad Jorsch [Fri, 21 Sep 2018 18:32:34 +0000 (14:32 -0400)]
Add join conditions to ActiveUsersPager

We're (very slowly and somewhat unofficially) moving towards using join
conditions everywhere, and here they're needed to avoid errors once the
actor migration reaches the READ_NEW stage.

Bug: T204767
Change-Id: I8bfe861fac7874f8938bed9bfac3b7ec6f478238

5 years agoMerge "Drop DoEditSectionLink, deprecated since 1.25"
jenkins-bot [Thu, 11 Oct 2018 19:27:39 +0000 (19:27 +0000)]
Merge "Drop DoEditSectionLink, deprecated since 1.25"

5 years agoMerge "tests: Add helper function for ini_set with automatic cleanup"
jenkins-bot [Thu, 11 Oct 2018 19:05:51 +0000 (19:05 +0000)]
Merge "tests: Add helper function for ini_set with automatic cleanup"

5 years agoMerge "Load installer i18n when running update.php"
jenkins-bot [Thu, 11 Oct 2018 18:59:34 +0000 (18:59 +0000)]
Merge "Load installer i18n when running update.php"

5 years agoMerge "messagecache: avoid caching message pages that do not override"
jenkins-bot [Thu, 11 Oct 2018 18:59:24 +0000 (18:59 +0000)]
Merge "messagecache: avoid caching message pages that do not override"

5 years agoMerge "Do not retry the ThumbnailRenderJob."
jenkins-bot [Thu, 11 Oct 2018 18:32:40 +0000 (18:32 +0000)]
Merge "Do not retry the ThumbnailRenderJob."

5 years agoLoad installer i18n when running update.php
Reedy [Thu, 11 Oct 2018 18:20:30 +0000 (19:20 +0100)]
Load installer i18n when running update.php

Bug: T206765
Change-Id: Ie1c1a5dbf7c905eaca55777448e5aba00267ed31

5 years agoMerge "Revert "Unwrap HTML loaded from parser cache""
jenkins-bot [Thu, 11 Oct 2018 18:11:55 +0000 (18:11 +0000)]
Merge "Revert "Unwrap HTML loaded from parser cache""

5 years ago.mailmap: Add a few new entries
James D. Forrester [Wed, 10 Oct 2018 23:34:43 +0000 (16:34 -0700)]
.mailmap: Add a few new entries

Change-Id: Iaacd5eff9c01ae9c03cf002a5063cae78cfb9e37

5 years agoAllow and use type Language instead of string for $lang of doEditSectionLink
Fomafix [Wed, 30 May 2018 04:33:01 +0000 (06:33 +0200)]
Allow and use type Language instead of string for $lang of doEditSectionLink

Hard-deprecate that the parameters $tooltip and $lang are optional.
Hard-deprecate other types than Language for parameter $lang.

Change-Id: I3ce048e3d0de9a4e96e2aa05d75a4ce41c3ec964
Depends-On: Ibe295e7020e995eea52e319feaf59c635f8bb4dc

5 years agoDo not retry the ThumbnailRenderJob.
Petr Pchelko [Thu, 11 Oct 2018 15:19:41 +0000 (08:19 -0700)]
Do not retry the ThumbnailRenderJob.

The job is a warmup for the thumbnail cache, so loosing it is not
an issue. Most of the times thumbnail rendering fails because of
non-renderable or broken images, or because the thumbnail was
already created by a request. These conditions will not be fixed
by retrying, will only create more load on Thumbor.

Bug: T203135
Change-Id: Ib4640eb13ca93f7350ff0671fc559a76ebbbb1e9

5 years agoMessageCache: replace should actually replace, not reload
Brad Jorsch [Wed, 26 Sep 2018 16:56:58 +0000 (12:56 -0400)]
MessageCache: replace should actually replace, not reload

Prior to I462554b30, MessageCache::replace() did just that: it took the
existing cache and updated the one entry.

In I462554b30, the rearrangement of work into a DeferredUpdate
introduced a bug: the in-process cache was updated, but when the shared
cache was loaded later the entry was never updated in there so the
shared caches kept the old value. This was found in code review and
worked around by reloading all the messages from the database instead of
updating the existing cache.

But all that extra work reloading everything from the database causes
major slowness saving any MediaWiki-namespace page when the wiki has
many such small pages. Let's go back and fix the bug so replace() can
again replace instead of reloading everything.

Bug: T203925
Change-Id: Ife8e1bd6f143f480eb8da09b817c85aadf33a923

5 years agoOnly expand `{{...}}` in messages once
C. Scott Ananian [Thu, 11 Oct 2018 13:05:05 +0000 (09:05 -0400)]
Only expand `{{...}}` in messages once

If we're going to call `OutputPage::addWikiText` to parse the message,
we don't need to pre-expand `{{...}}` markup before passing it to the
parser.  This makes these callsites consistent with how
`OutputPage::addWikiMsg()` inserts messages.

Bug: T206574
Change-Id: I2f68f73365df876e6f9d017e4e3ddea39c4a1284

5 years agoMerge "Drop File / MediaHandler::getStreamHeaders(), deprecated since 1.30"
jenkins-bot [Thu, 11 Oct 2018 07:44:08 +0000 (07:44 +0000)]
Merge "Drop File / MediaHandler::getStreamHeaders(), deprecated since 1.30"

5 years agoMerge "Drop DeferredUpdates::setImmediateMode(), deprecated since 1.29"
jenkins-bot [Thu, 11 Oct 2018 07:44:02 +0000 (07:44 +0000)]
Merge "Drop DeferredUpdates::setImmediateMode(), deprecated since 1.29"

5 years agoMerge "Drop ChangesListSpecialPageFilters, deprecated in 1.29 and uncalled"
jenkins-bot [Thu, 11 Oct 2018 07:36:20 +0000 (07:36 +0000)]
Merge "Drop ChangesListSpecialPageFilters, deprecated in 1.29 and uncalled"

5 years agoAccept BCP 47 codes as aliases for nonstandard variants
C. Scott Ananian [Tue, 3 Jul 2018 20:12:38 +0000 (16:12 -0400)]
Accept BCP 47 codes as aliases for nonstandard variants

The browser Accept-Language header uses BCP 47 codes, which don't
precisely match our internal mediawiki variant names in a number of
places.  Allow proper BCP 47 codes to alias our internal variants
for: Accept-Language parsing, URL parsing, user preferences, and
explicit enumeration of codes in LanguageConverter rules.

This is a replay of an earlier merged patch,
0818070c59eb4e8330496796b943951c01c7a573, which had to be reverted
because it was based on 8380f0173e79b66f0e2afd6c49cd88afb9f4f6f3 which
caused regressions in the Babel extension (T199941).

Change-Id: Ica89d9547c58967747ab0fa15d4e83be5378796d

5 years agoEnsure LanguageCode::bcp47() returns a valid BCP 47 language code
C. Scott Ananian [Tue, 26 Jun 2018 20:39:57 +0000 (16:39 -0400)]
Ensure LanguageCode::bcp47() returns a valid BCP 47 language code

MediaWiki uses a number of nonstandard codes which do not validate
according to the IANA language subtag registry.  Some of them have
the wrong semantics entirely: MediaWiki's `sr-ec` variant maps to
BCP 47 `sr-EC` which is "Serbian as used in Ethiopia" (!).

Extend LanguageCode::bcp47() to map our nonstandard codes to valid
BCP 47 language codes.  Export the mapping so that it can be used
in JavaScript's corresponding mw.language.bcp47() implementation
as well, and return the standard BCP 47 codes in the siteinfo
API.

Thanks to TheDJ (I10b4473c7e53f027812bbccf26bb47aec15fddfd) and
Fomafix (I93efc190714ba76247d30ba49fc21ae872fc3555) for previous
attempts at this!

Also removed a fixme for the name of 'Twi', dating back to 2004
(f59c3be23b209e178a917cb14ebedcc243c847b6) -- checking
tw.wikipedia.org it certainly appears that the autonym of 'Twi'
is correctly 'Twi'.

Tracking bugs for invalid language codes are T125073 and T145535.
Discussion of zh-XX => zh-HanX-XX mapping is at T198419.

This is a replay of an earlier merged patch,
8380f0173e79b66f0e2afd6c49cd88afb9f4f6f3, which had to be reverted
because it caused regressions in the Babel extension (T199941).

Bug: T34483
Bug: T106367
Bug: T120847
Depends-On: I27a5b8e45b34c6b57c1b612b11548001c88cd483
Change-Id: Iebbc604af21d7f2af9c1f1ab2574cb5f309bf6ed

5 years agoMerge "install.php: Allow extensions and skins to be specified"
jenkins-bot [Thu, 11 Oct 2018 05:34:33 +0000 (05:34 +0000)]
Merge "install.php: Allow extensions and skins to be specified"

5 years agotests: Add helper function for ini_set with automatic cleanup
Kunal Mehta [Thu, 11 Oct 2018 05:31:37 +0000 (22:31 -0700)]
tests: Add helper function for ini_set with automatic cleanup

Some tests need to change the value of an ini setting, and typically implement
cleanup handling themselves, usually imperfectly.

Provide a helper function, $this->setIniSetting(), which will take care of
teardown in the same way that $this->setMwGlobals() does.

Change-Id: I7be4198592f0aaf73a28d3c60acb307a918b1a1f

5 years agoMerge "Hard-deprecate hooks APIGetDescription and APIGetParamDescription"
jenkins-bot [Thu, 11 Oct 2018 05:30:09 +0000 (05:30 +0000)]
Merge "Hard-deprecate hooks APIGetDescription and APIGetParamDescription"

5 years agoMerge "WikiPage: Fix viewing of wiki redirects to NS_MEDIA"
jenkins-bot [Thu, 11 Oct 2018 01:54:19 +0000 (01:54 +0000)]
Merge "WikiPage: Fix viewing of wiki redirects to NS_MEDIA"

5 years agoWikiPage: Fix viewing of wiki redirects to NS_MEDIA
Alex Ezell [Tue, 9 Oct 2018 15:51:04 +0000 (11:51 -0400)]
WikiPage: Fix viewing of wiki redirects to NS_MEDIA

If a user creates a redirect to a Media namespace title, a fatal
error is thrown on viewing such rediect because we protect against
redirecting to virtual namespaces. This fix catches this kind of
redirect and modifies the namespace to be File before the Title object
is created.

Follow-up from 613e2699.

Bug: T203942
Change-Id: Ib211d98498f635862fea6bf3e7395f4f8718b3d8

5 years agoActorMigration: Remove possibility of read-both
Brad Jorsch [Tue, 18 Sep 2018 18:21:20 +0000 (14:21 -0400)]
ActorMigration: Remove possibility of read-both

When this was originally written, the plan was to read both the old and
new fields during the transition period, while stopping writes to them
midway through. It turns out that the WHERE conditions to do read-both
correctly are generally not handled well by the database and working
around that would require a lot of complicated code (see what's being
removed from ApiQueryUserContribs here, for example).

We can simplify things greatly by instead having it write both fields
during the transition period, reading from the old for the first part
and the new for the second part, as is being done for MCR.

Bug: T204669
Change-Id: I4764c1c7883dc1003cb12729455c8107319f70b1
Depends-On: I845f6ae462f2539ebd35cbb5f2ca8b5714e2c1fb
Depends-On: I88b31b977543fdbdf69f8c1158e77e448df94e11

5 years agoHTMLInfoField: Undo breaking change, deprecate instead, add release notes
Bartosz Dziewoński [Tue, 2 Oct 2018 21:22:00 +0000 (23:22 +0200)]
HTMLInfoField: Undo breaking change, deprecate instead, add release notes

Follow-up to e6eb87ae2028d9d3f9317d75cced42511ed97b9e.

Bug: T203202
Bug: T205956
Change-Id: I2d19d376d218c59e4ea36e8635e883afac2adea6

5 years agoMerge "Drop wfUsePHP, deprecated in 1.30 and unused"
jenkins-bot [Wed, 10 Oct 2018 23:49:37 +0000 (23:49 +0000)]
Merge "Drop wfUsePHP, deprecated in 1.30 and unused"

5 years agoMerge "Fix TitlePermissionTest failures due to test leakage"
jenkins-bot [Wed, 10 Oct 2018 23:36:02 +0000 (23:36 +0000)]
Merge "Fix TitlePermissionTest failures due to test leakage"

5 years agoMerge "rdbms: Database::selectDB() update the domain and handle failure better"
jenkins-bot [Wed, 10 Oct 2018 23:20:49 +0000 (23:20 +0000)]
Merge "rdbms: Database::selectDB() update the domain and handle failure better"

5 years agoDrop ParserLimitReport, deprecated in 1.22
James D. Forrester [Wed, 10 Oct 2018 23:20:18 +0000 (16:20 -0700)]
Drop ParserLimitReport, deprecated in 1.22

Change-Id: I4898d92569bd823f09c12f68fa186e2e139790a7

5 years agoDrop UnknownAction, deprecated in 1.19(!)
James D. Forrester [Wed, 10 Oct 2018 23:17:28 +0000 (16:17 -0700)]
Drop UnknownAction, deprecated in 1.19(!)

Change-Id: Ia75552e69c07f6dc5da2f1e04ea813c912b04aef

5 years agoFix TitlePermissionTest failures due to test leakage
Aaron Schulz [Wed, 10 Oct 2018 04:41:51 +0000 (21:41 -0700)]
Fix TitlePermissionTest failures due to test leakage

Bug: T201776
Change-Id: I46d44c031ec45ac0be4c372891d2992c1e4f35ab

5 years agoMerge "Minor OrderedStreamingForkController improvements"
jenkins-bot [Wed, 10 Oct 2018 22:41:57 +0000 (22:41 +0000)]
Merge "Minor OrderedStreamingForkController improvements"

5 years agoDrop wfRunHooks, deprecated since 1.25
James D. Forrester [Wed, 10 Oct 2018 22:28:49 +0000 (15:28 -0700)]
Drop wfRunHooks, deprecated since 1.25

Change-Id: I0350fba3f1a4a4ff500af746609bc9c6b46f0bdf

5 years agoDrop UserGetImplictGroups, deprecated since 1.25
James D. Forrester [Wed, 10 Oct 2018 22:28:34 +0000 (15:28 -0700)]
Drop UserGetImplictGroups, deprecated since 1.25

Change-Id: Iffe29131fcc85d3477fe93508902d8ea982289f5

5 years agoDrop DoEditSectionLink, deprecated since 1.25
James D. Forrester [Wed, 10 Oct 2018 22:19:56 +0000 (15:19 -0700)]
Drop DoEditSectionLink, deprecated since 1.25

Change-Id: I78b468da34467863047cd01623997dc67cc4fc76

5 years agoDrop File / MediaHandler::getStreamHeaders(), deprecated since 1.30
James D. Forrester [Wed, 10 Oct 2018 22:17:16 +0000 (15:17 -0700)]
Drop File / MediaHandler::getStreamHeaders(), deprecated since 1.30

Change-Id: Ia4f6cee5674a492c098c343943095cb668172311

5 years agoDrop DeferredUpdates::setImmediateMode(), deprecated since 1.29
James D. Forrester [Wed, 10 Oct 2018 22:17:00 +0000 (15:17 -0700)]
Drop DeferredUpdates::setImmediateMode(), deprecated since 1.29

Change-Id: I8ae7dedf956034981081d2bcec630d6724921269

5 years agoDrop ChangesListSpecialPageFilters, deprecated in 1.29 and uncalled
James D. Forrester [Wed, 10 Oct 2018 22:10:18 +0000 (15:10 -0700)]
Drop ChangesListSpecialPageFilters, deprecated in 1.29 and uncalled

Change-Id: I03a9bce0d1085dc30dbc5c3408b4cea154ade19a

5 years agoDrop wfUsePHP, deprecated in 1.30 and unused
James D. Forrester [Wed, 10 Oct 2018 22:04:51 +0000 (15:04 -0700)]
Drop wfUsePHP, deprecated in 1.30 and unused

Change-Id: Ic247af4e9b2b2e687ee74e990e69401426be7c31

5 years agoMerge "RCFilters: Improve circle mixin and change to new standard icon size"
jenkins-bot [Wed, 10 Oct 2018 22:09:02 +0000 (22:09 +0000)]
Merge "RCFilters: Improve circle mixin and change to new standard icon size"

5 years agoMinor OrderedStreamingForkController improvements
Timo Tijhof [Wed, 10 Oct 2018 19:17:37 +0000 (20:17 +0100)]
Minor OrderedStreamingForkController improvements

Follows-up c94dea7029cae.

* Avoid strlen() where a strict check suffices.
* Use substr() for both comparison and stripping, avoid
  potentially expensive, but also fragile, because strlen()-1
  can  produce $str[-1], which would
  > PHP Notice:  Uninitialized string offset: -1
  Luckily, the implied null would work as expected, given that
  `null !== "\n"` and produces the same result.

Change-Id: If61e5e412aaa2dc7c00c4441b3b7bd5f04160ec8

5 years agoMerge "Remove pear/mail_mime-decode"
jenkins-bot [Wed, 10 Oct 2018 20:58:50 +0000 (20:58 +0000)]
Merge "Remove pear/mail_mime-decode"

5 years agoMerge "Hard deprecate OutputPage::addWikiText*Tidy() methods"
jenkins-bot [Wed, 10 Oct 2018 20:14:12 +0000 (20:14 +0000)]
Merge "Hard deprecate OutputPage::addWikiText*Tidy() methods"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 10 Oct 2018 19:55:03 +0000 (21:55 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I9682ae829e3659b2cf672847961c3be3d8578568

5 years agoRemove pear/mail_mime-decode
Reedy [Wed, 10 Oct 2018 17:41:00 +0000 (18:41 +0100)]
Remove pear/mail_mime-decode

Bug: T109121
Change-Id: I540b8a59dbe88c27f49b3c4cd8740872afd5d8bf

5 years agomessagecache: avoid caching message pages that do not override
Aaron Schulz [Tue, 2 Oct 2018 17:59:28 +0000 (10:59 -0700)]
messagecache: avoid caching message pages that do not override

Clean up individual message cache handling when the master key is
volatile. The goal is not to treat the message as gone but to re-fetch
it when accessed rather than cache the value in the main/process cache.

Bug: T193271
Change-Id: I4bcaf10c1516e7c96c2d0963722affeaf80272e0

5 years agoRCFilters: Improve circle mixin and change to new standard icon size
Volker E [Sun, 8 Apr 2018 03:20:20 +0000 (20:20 -0700)]
RCFilters: Improve circle mixin and change to new standard icon size

Improve circle mixin, variables and apply standard icon size:
- Apply new icon size of 20px,
- Divert `.mw-rcfilters-mixin-circle()` into two mixins, applying former
only on circle classes to not repeat output of shared properties for
each color,
- Add new parameter to apply `px` based `min-width`/`min-height` to
circumvent rendering issues,
- Rename variables for unification with WikimediaUI Base vars and easier
readability

Bug: T190980
Change-Id: I76fec57ff237ba02afefcea28916d8348bac9b0e

5 years agordbms: Database::selectDB() update the domain and handle failure better
Aaron Schulz [Tue, 14 Aug 2018 23:44:41 +0000 (16:44 -0700)]
rdbms: Database::selectDB() update the domain and handle failure better

LoadBalancer uses Database::getDomainId() for deciding which keys to use
in the foreign connection handle arrays. This method should reflect any
changes made to the DB selection.

If the query fails, then do not change domain field. This is the sort of
approach that LoadBalancer is expects in openForeignConnection(). Also,
throw an exception when selectDB() fails.

The db/schema/prefix fields of Database no longer exist in favor of just
using the newer currentDomain field.

Also:
* Add IDatabase::selectDomain() method and made selectDB() wrap it.
* Extract the DB name from sqlite files if not explicitly provided.
* Fix inconsistent open() return values from Database subclasses.
* Make a relationSchemaQualifier() method to handle the concern of
  omitting schema names in queries. The means that getDomainId() can
  still return the right value, rather than confusingly omitt the schema.
* Make RevisionStore::checkDatabaseWikiId() account for the domain schema.
  Unlike d2a4d614fce09c, this does not incorrectly assume the storage is
  always for the current wiki domain. Also, LBFactorySingle sets the local
  domain so it is defined even in install.php.
* Make RevisionStoreDbTestBase actually set the LoadBalancer local domain.
* Make RevisionTest::testLoadFromTitle() account for the domain schema.

Bug: T193565
Change-Id: I6e51cd54c6da78830b38906b8c46789c79498ab5

5 years agoHard deprecate OutputPage::addWikiText*Tidy() methods
C. Scott Ananian [Wed, 26 Sep 2018 17:22:38 +0000 (13:22 -0400)]
Hard deprecate OutputPage::addWikiText*Tidy() methods

These have been replaced with OutputPage::addWikiTextAsContent().
There is only one apparent use outside core, in the ProofreadPage
extension.

Bug: T198214
Depends-On: I826e463c1623481c11156a55a5b7e1da0aa27b8b
Change-Id: I4b1a9429029bfbbf70b2d5da1b290319ecbbdf3a

5 years agoHard deprecate unused OutputPage::addWikiText* methods
C. Scott Ananian [Fri, 21 Sep 2018 17:16:42 +0000 (13:16 -0400)]
Hard deprecate unused OutputPage::addWikiText* methods

Codesearch shows no users of `OutputPage::addWikiTextWithTitle()`,
and no users of `OutputPage::addWikiTextTitle()` (other than the
implicit uses by the other `OutputPage::addWikiText*()` methods).

These methods produce untidy output, which future parsers won't
support.

Bug: T198214
Change-Id: Id5ee3bdfa6c464e3a92af82af7bc7317ca9d07a9

5 years agoUpdate users of deprecated OutputPage::addWikiText*Tidy() methods
C. Scott Ananian [Wed, 26 Sep 2018 17:17:14 +0000 (13:17 -0400)]
Update users of deprecated OutputPage::addWikiText*Tidy() methods

This is a follow-up to Ia58910164baaca608cea3b24333b7d13ed773339 which
added new & improved names for the addWikiText*Tidy() methods.

Bug: T198214
Depends-On: I42d198e6d03afd5b976da741f235c175bfe9f767
Change-Id: I1993c2009e861fdb45c9b1bd42eab1e28a776d9a