lhc/web/wiklou.git
5 years agoRemove ugly function existence check
Max Semenik [Wed, 3 Oct 2018 21:43:10 +0000 (14:43 -0700)]
Remove ugly function existence check

Instead, add the function into the base class.
Also, remove a pointless else.

Bug: T205040
Change-Id: I371de90b3ebef133be92b49be505db8d73f4e2c4

5 years agoMerge "SECURITY: Fix permissions check for patrol action"
jenkins-bot [Wed, 3 Oct 2018 19:50:32 +0000 (19:50 +0000)]
Merge "SECURITY: Fix permissions check for patrol action"

5 years agoSECURITY: Fix permissions check for patrol action
Kosta Harlan [Wed, 3 Oct 2018 16:47:14 +0000 (12:47 -0400)]
SECURITY: Fix permissions check for patrol action

Return existing errors instead of empty array in checkUserConfigPermissions().
Returning an empty array wiped out previously-found errors.

Also add test coverage for patrol action.

Bug: T206130
Change-Id: I2df0551c5837adc578b27082ab6ba2ac95d937f8

5 years agoMerge "Show copyright based on $output->hasCopyright()"
jenkins-bot [Wed, 3 Oct 2018 18:04:15 +0000 (18:04 +0000)]
Merge "Show copyright based on $output->hasCopyright()"

5 years agoMerge "Remove unused function: isStructuredFilterUiEnabledByDefault"
jenkins-bot [Wed, 3 Oct 2018 18:01:30 +0000 (18:01 +0000)]
Merge "Remove unused function: isStructuredFilterUiEnabledByDefault"

5 years agoShow copyright based on $output->hasCopyright()
Stephane Bisson [Wed, 3 Oct 2018 13:12:37 +0000 (09:12 -0400)]
Show copyright based on $output->hasCopyright()

Introducing setCopyright/hasCopyright in OutputPage to
make the showing of the copyright message controllable
by pages other than articles.

hasCopyright defaults to isArticle() to preserve the rule
that all article should show the copyright.

This is used by Flow to show the copyright
on various pages that contain user-generated
content.

Bug: T184960
Change-Id: I3a50dbcedc6b119b9262c50cb3a84b0dd230fb3d

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 3 Oct 2018 15:20:20 +0000 (17:20 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ic0af665f26aa1af0bd706ee26bb811d0a482ec2b

5 years agoDeprecate Language::setCode as public method
Fomafix [Sat, 7 Jul 2018 09:53:04 +0000 (11:53 +0200)]
Deprecate Language::setCode as public method

setCode changes the language code for the Language object but it also
replaces the whole language codes for all Language objects.

> $lang = Language::factory( 'fr' )

> $lang2 = Language::factory( 'fr' )

> $lang->setCode( 'it' )

> print $lang2->getCode()
it
> $lang3 = Language::factory( 'fr' )

> print $lang3->getCode()
it

Better assign a new Language object.

Also add more tests for Language::equals.

Depends-On: I61439bac82021344c3f9a6056cccd937b3450af2
Depends-On: I2d9e551d6eb33f28f42aeaf48160eba21b83881f
Change-Id: I201b479f58e63c9c40fb8a3ec9575a551fb35235

5 years agoMerge "API: Handle empty xxnamespace parameter in ApiQueryBacklinksprop"
jenkins-bot [Wed, 3 Oct 2018 06:42:17 +0000 (06:42 +0000)]
Merge "API: Handle empty xxnamespace parameter in ApiQueryBacklinksprop"

5 years agoMerge "AutoloadGenerator: Filter PSR4-compliant classes instead of ignoring directories"
jenkins-bot [Wed, 3 Oct 2018 06:41:03 +0000 (06:41 +0000)]
Merge "AutoloadGenerator: Filter PSR4-compliant classes instead of ignoring directories"

5 years agoMerge "Migrate image descriptions from image_comment_temp"
jenkins-bot [Wed, 3 Oct 2018 01:23:54 +0000 (01:23 +0000)]
Merge "Migrate image descriptions from image_comment_temp"

5 years agoMerge "RCFilters: better vertical alignment of checkbox and text in menus"
jenkins-bot [Wed, 3 Oct 2018 00:43:17 +0000 (00:43 +0000)]
Merge "RCFilters: better vertical alignment of checkbox and text in menus"

5 years agoRCFilters: better vertical alignment of checkbox and text in menus
Stephane Bisson [Tue, 2 Oct 2018 16:55:12 +0000 (12:55 -0400)]
RCFilters: better vertical alignment of checkbox and text in menus

- Remove min-height so menu items are a little smaller and
  their content is vertically-aligned.

- Force `vertical-align: middle;` for checkboxes by overriding
  OOUI with extreme specificity.

Bug: T200364
Change-Id: If0b2b5c1b749f913badbd0c02a85852ec0007020

5 years agoMerge "MessageCache: remove confusing and unused $isFullKey parameter from get()"
jenkins-bot [Tue, 2 Oct 2018 23:51:03 +0000 (23:51 +0000)]
Merge "MessageCache: remove confusing and unused $isFullKey parameter from get()"

5 years agoMessageCache: remove confusing and unused $isFullKey parameter from get()
Aaron Schulz [Tue, 2 Oct 2018 20:53:32 +0000 (13:53 -0700)]
MessageCache: remove confusing and unused $isFullKey parameter from get()

Follows-up cba0fb1c1576324e87b27, which removed the last caller.

Change-Id: I00c17fedff39b1b35519cff2a0f8eac3e4d6f2ab

5 years agoLanguage: Don't return aliases to namespaces that don't exist
Brad Jorsch [Tue, 2 Oct 2018 21:18:38 +0000 (17:18 -0400)]
Language: Don't return aliases to namespaces that don't exist

On a multi-wiki server using a l10n cache, the cache will probably
include aliases from all extensions enabled for any wiki while the
namespaces themselves will only be defined on the wikis where the
extension is loaded.

Bug: T206030
Change-Id: I985dfa3eb17944d5fc0c5be0979be21504fb1341

5 years agoMerge "rdbms: make * consistently act like in select/insertSelect methods"
jenkins-bot [Tue, 2 Oct 2018 16:44:54 +0000 (16:44 +0000)]
Merge "rdbms: make * consistently act like  in select/insertSelect methods"

5 years agoMerge "Add audience parameter to PoolWorkArticleView"
jenkins-bot [Tue, 2 Oct 2018 15:12:05 +0000 (15:12 +0000)]
Merge "Add audience parameter to PoolWorkArticleView"

5 years agoMigrate image descriptions from image_comment_temp
Brad Jorsch [Wed, 7 Mar 2018 16:40:56 +0000 (11:40 -0500)]
Migrate image descriptions from image_comment_temp

image_comment_temp was always intended to be temporary, until an
expensive schema change on Wikimedia Commons's image table could be
done. Now that that has been done, stop writing image_comment_temp and
add a migration script to copy existing data into img_description_id.

Ic8efeddc will remove the reads from image_comment_temp and drop the
image_comment_temp table.

Bug: T188132
Change-Id: Iab5f521577a415b2dc213b517ee8a0dca4fdd0aa

5 years agoMerge "Use pseudo elements to style changelist-separators on Contributions"
jenkins-bot [Tue, 2 Oct 2018 12:24:58 +0000 (12:24 +0000)]
Merge "Use pseudo elements to style changelist-separators on Contributions"

5 years agoAdd audience parameter to PoolWorkArticleView
Gergő Tisza [Tue, 2 Oct 2018 01:33:28 +0000 (18:33 -0700)]
Add audience parameter to PoolWorkArticleView

The old behavior was that the audience was RAW if the revision object
parameter got passed in, otherwise PUBLIC. This was undocumented and
not used outside core; this patch gets rid of it in favor of an
explicit argument.

Bug: T205578
Change-Id: Ic7cdb38f658f6d85c48ff13c7f84c64a45c9b1ee

5 years agoMerge "Add type hint to invalidateImageDescriptions()"
jenkins-bot [Tue, 2 Oct 2018 10:33:19 +0000 (10:33 +0000)]
Merge "Add type hint to invalidateImageDescriptions()"

5 years agoAdd type hint to invalidateImageDescriptions()
Aaron Schulz [Tue, 2 Oct 2018 06:20:10 +0000 (23:20 -0700)]
Add type hint to invalidateImageDescriptions()

Change-Id: Ie6322f25c959f5de4bbccd8f47d40f112817d00b

5 years agoMerge "Replace WikiExporter streaming (unbuffered) mode with batched queries"
jenkins-bot [Tue, 2 Oct 2018 05:16:07 +0000 (05:16 +0000)]
Merge "Replace WikiExporter streaming (unbuffered) mode with batched queries"

5 years agoMerge "ApiOptions: fix resetting some preferences to default"
jenkins-bot [Tue, 2 Oct 2018 01:06:20 +0000 (01:06 +0000)]
Merge "ApiOptions: fix resetting some preferences to default"

5 years agoMerge "Use varargs in global functions"
jenkins-bot [Tue, 2 Oct 2018 01:04:11 +0000 (01:04 +0000)]
Merge "Use varargs in global functions"

5 years agoRemove unused function: isStructuredFilterUiEnabledByDefault
Stephane Bisson [Tue, 2 Oct 2018 00:34:55 +0000 (20:34 -0400)]
Remove unused function: isStructuredFilterUiEnabledByDefault

Follow up Id3799fefd21cd9bea0e089a5e12576ee9ea1085e

Bug: T196033
Change-Id: Ib2ad41be8648f7ff8b4a218fd66c328dee3924d9

5 years agoCategoryTagItemWidget: Drop backwards-compatibility "Capsule" name
James D. Forrester [Tue, 2 Oct 2018 00:32:31 +0000 (17:32 -0700)]
CategoryTagItemWidget: Drop backwards-compatibility "Capsule" name

Not used for months.

Change-Id: Ie85d2d0ef6ebc3e1e2502519a02b8fadd8d53b7a

5 years agoUse pseudo elements to style changelist-separators on Contributions
jdlrobson [Tue, 18 Sep 2018 21:11:08 +0000 (14:11 -0700)]
Use pseudo elements to style changelist-separators on Contributions

Currently, these separators are unnecessarily hardcoded in HTML.
This is problematic, as it limits the extent to which skins such
as Minerva and Timeless can skin these pages.

If the pseudo selector is not available (e.g. legacy browsers)
this degrades nicely to whitespace and the page is still useable.

Right now, these changes are scoped to pages uses the ContribsPager
(used by Special:Contributions)
but we can adopt them in other pages once we have this approach set in
stone (CSS)

Bug: T205581
Change-Id: Ia2c485e6058ebf4282ed2f7eb7b046b2deb03f57

5 years agoHard-deprecate password handling in User
Gergő Tisza [Thu, 14 Jan 2016 23:53:56 +0000 (15:53 -0800)]
Hard-deprecate password handling in User

Add wfDeprecated for User::checkPassword(), User::setPassword(),
User::setInternalPassword() and User::checkTemporaryPassword().
With AuthManager mediating between the caller and a set of
authentication providers in a potentially multi-step process,
a password check or change now cannot always be expressed
with a single-step succed-or-fail process. Callers should use
AuthManager::beginAuthentication() with a PasswordAuthenticationRequest
for password checks, and AuthManager::changeAuthenticationData()
for a password change.

Bug: T91699
Change-Id: Ib0ae8f1ff10ae6c2655d529db8b3a32e0cb489b0

5 years agoMerge "Remove temporary rcfilters variables"
jenkins-bot [Mon, 1 Oct 2018 23:09:28 +0000 (23:09 +0000)]
Merge "Remove temporary rcfilters variables"

5 years agoApiOptions: fix resetting some preferences to default
Max Semenik [Sat, 14 Jul 2018 03:14:06 +0000 (20:14 -0700)]
ApiOptions: fix resetting some preferences to default

For preferences like 'skin' that have a limited number of values, null
is not a valid value, thus attempts to reset them fail with
"Validation error for \"skin\": This value is required."

Bug: T65080

Change-Id: I86554a6d30c8ab970740d8682fb2261476de0677

5 years agordbms: make * consistently act like in select/insertSelect methods
Aaron Schulz [Mon, 1 Oct 2018 21:31:53 +0000 (14:31 -0700)]
rdbms: make * consistently act like  in select/insertSelect methods

This now matches the documentation of insertSelect()

Bug: T202553
Change-Id: Ie6602fdd3b48b9136de7c65289c85ced5f5f2f1d

5 years agoMerge "Remove __METHOD__ in ServiceWiring return array"
jenkins-bot [Mon, 1 Oct 2018 19:43:43 +0000 (19:43 +0000)]
Merge "Remove __METHOD__ in ServiceWiring return array"

5 years agoFix caller name in JobRunner::commitMasterChanges
Umherirrender [Sun, 30 Sep 2018 15:21:11 +0000 (17:21 +0200)]
Fix caller name in JobRunner::commitMasterChanges

Use the given fname for all places.
The __METHOD__ inside the unlock closure would be shown as {closure} in
logs

Change-Id: I87ef26e893af858f58d1a77dcb2d8ee192456f5c

5 years agoMerge "Preserve whitespace in search index text content"
jenkins-bot [Mon, 1 Oct 2018 18:22:48 +0000 (18:22 +0000)]
Merge "Preserve whitespace in search index text content"

5 years agoMerge "Fix [[MediaWiki:Config-install-success/en]] translation issues"
jenkins-bot [Mon, 1 Oct 2018 16:12:12 +0000 (16:12 +0000)]
Merge "Fix [[MediaWiki:Config-install-success/en]] translation issues"

5 years agoMerge "Make messages [[MediaWiki:Config-db-web-account-same/qqq]] and [[MediaWiki...
jenkins-bot [Mon, 1 Oct 2018 16:11:28 +0000 (16:11 +0000)]
Merge "Make messages [[MediaWiki:Config-db-web-account-same/qqq]] and [[MediaWiki:Config-db-web-create]] clearer"

5 years agoMerge "rdbms: Document a bunch of stuff about query verbs"
jenkins-bot [Mon, 1 Oct 2018 15:55:38 +0000 (15:55 +0000)]
Merge "rdbms: Document a bunch of stuff about query verbs"

5 years agoAPI: Handle empty xxnamespace parameter in ApiQueryBacklinksprop
Brad Jorsch [Mon, 1 Oct 2018 14:18:40 +0000 (10:18 -0400)]
API: Handle empty xxnamespace parameter in ApiQueryBacklinksprop

If the xxnamespace parameter is specified but empty, we don't need to do
anything because there will be no results.

Bug: T205810
Change-Id: Iae5d766a5408368cadd01583d18b745661304a7f

5 years agoMerge "Add waitForReplication in DeleteLocalPasswords"
jenkins-bot [Mon, 1 Oct 2018 14:13:15 +0000 (14:13 +0000)]
Merge "Add waitForReplication in DeleteLocalPasswords"

5 years agoAdd waitForReplication in DeleteLocalPasswords
Amir Sarabadani [Mon, 1 Oct 2018 13:09:22 +0000 (15:09 +0200)]
Add waitForReplication in DeleteLocalPasswords

It almost brought commonswiki down when it was run

Bug: T201009
Change-Id: Ia825f9572b8c71c5627eb627c58f51a689c2f8aa

5 years agoUse Unicode notation (U+XXXX) instead of HTML notation (&#xXXXX;) in comments
Fomafix [Mon, 1 Oct 2018 10:24:00 +0000 (12:24 +0200)]
Use Unicode notation (U+XXXX) instead of HTML notation (&#xXXXX;) in comments

Performed using:
sed -i 's/&#x\([0-9a-f]*\);/U+\U\1/gi' languages/messages/* languages/classes/*

Change-Id: Id489ae5ffb10bc5b047f72bc6834dd0488b5f940

5 years agoMerge "Change the Unicode numbers in the comments in MessagesPs"
jenkins-bot [Mon, 1 Oct 2018 06:24:38 +0000 (06:24 +0000)]
Merge "Change the Unicode numbers in the comments in MessagesPs"

5 years agoChange the Unicode numbers in the comments in MessagesPs
Amir Aharoni [Sun, 30 Sep 2018 21:48:23 +0000 (00:48 +0300)]
Change the Unicode numbers in the comments in MessagesPs

The numbers are supposed to be the same as in MessagesFa.php.

Change-Id: Icd3e8c8ac1d5beb194dcbce36100a373816bc506

5 years agoUpdate CoC file in Core
Alangi Derick [Sun, 30 Sep 2018 13:51:35 +0000 (14:51 +0100)]
Update CoC file in Core

Update CoC file in core to have the "Special:MyLanguage" so
it links to the user's preferred language CoC page.

Bug: T202047
Change-Id: Iacecf59c9f3b3df171233aeb7bdde1bc1e9444ae

5 years agoRemove __METHOD__ in ServiceWiring return array
Umherirrender [Sun, 30 Sep 2018 15:25:59 +0000 (17:25 +0200)]
Remove __METHOD__ in ServiceWiring return array

It is in a callback and would provide only {closures}.
It is logged to a channel, where the context is known.

Change-Id: I15ee43ff9383970fc6d5b5cc45678397d2096604

5 years agoMerge "HTMLInfoField: Support 'rawrow' in OOUI mode"
jenkins-bot [Sun, 30 Sep 2018 18:18:26 +0000 (18:18 +0000)]
Merge "HTMLInfoField: Support 'rawrow' in OOUI mode"

5 years agoMerge "Create UserGetRightsRemove hook"
jenkins-bot [Sun, 30 Sep 2018 18:12:50 +0000 (18:12 +0000)]
Merge "Create UserGetRightsRemove hook"

5 years agoFix logged method in LoadBalancer
Umherirrender [Sun, 30 Sep 2018 15:19:21 +0000 (17:19 +0200)]
Fix logged method in LoadBalancer

Seeing {closure} in the logs as caller is not helpful

Change-Id: I45d9be25acdcc70c7d9755c15f68f7bc6887e166

5 years agoFix caller name in DatabasePostgresTest
Umherirrender [Sun, 30 Sep 2018 15:14:16 +0000 (17:14 +0200)]
Fix caller name in DatabasePostgresTest

Seeing {closure} in the logs as caller is not helpful
Also add some missing caller name, which avoids Database::query as
caller in the logs
Change-Id: I3cab186cd63b295d1e4d1ca5232bc81925a85eb0

5 years agoFix caller name in DatabaseMysqlBase::getMasterServerInfo/getServerId
Umherirrender [Sun, 30 Sep 2018 15:09:58 +0000 (17:09 +0200)]
Fix caller name in DatabaseMysqlBase::getMasterServerInfo/getServerId

Seeing {closure} in the logs as caller is not helpful

Change-Id: I63adbfcf4944747670a3a30182f6bd5cb6d0e48b

5 years agoFix logged method in MessageCache::replace/loadCachedMessagePageEntry
Umherirrender [Sun, 30 Sep 2018 15:06:53 +0000 (17:06 +0200)]
Fix logged method in MessageCache::replace/loadCachedMessagePageEntry

Seeing {closure} in the logs as caller is not helpful

Change-Id: Iddfb6042bba2a59a9f21f533b748c96478a87b97

5 years agoFix logged method in NameTableStore::getName
Umherirrender [Sun, 30 Sep 2018 15:02:46 +0000 (17:02 +0200)]
Fix logged method in NameTableStore::getName

Seeing {closure} in the logs as caller is not helpful

Change-Id: I6a54ebf87024706b7890c7fe003b5380933fe861

5 years agoFix caller name in PurgeJobUtils::invalidatePages
Umherirrender [Sun, 30 Sep 2018 14:59:56 +0000 (16:59 +0200)]
Fix caller name in PurgeJobUtils::invalidatePages

Seeing {closure} in the logs as caller is not helpful

Change-Id: I252b23e46983b359cbad32323c3a063e7a7afcb5

5 years agoFix caller name in LocalFile::recordUpload2
Umherirrender [Sun, 30 Sep 2018 14:57:54 +0000 (16:57 +0200)]
Fix caller name in LocalFile::recordUpload2

Seeing {closure} in the logs as caller is not helpful

Change-Id: Idbf6ac9606d0f75cae452afffe133c5e3973f334

5 years agoFix caller name in File::getDescriptionText
Umherirrender [Sun, 30 Sep 2018 14:52:06 +0000 (16:52 +0200)]
Fix caller name in File::getDescriptionText

Seeing {closure} in the logs as caller is not helpful

Change-Id: I415e2bb691650bc34adfb750c7a70a5d29176849

5 years agoFix caller name in LocalPasswordPrimaryAuthenticationProvider
Umherirrender [Sun, 30 Sep 2018 14:17:27 +0000 (16:17 +0200)]
Fix caller name in LocalPasswordPrimaryAuthenticationProvider

Seeing {closure} in the logs as caller is not helpful

Change-Id: I8dc921feb13432ed636686f918d8747ae71cf62b

5 years agoFix caller name in ApiStashEdit::parseAndStash
Umherirrender [Sun, 30 Sep 2018 14:01:23 +0000 (16:01 +0200)]
Fix caller name in ApiStashEdit::parseAndStash

Seeing {closure} in the logs as caller is not helpful

Change-Id: Id77253bdd4b65b0673214e7bf6ca3cc26bd155fa

5 years agoFix caller name in SiteStats::numberingroup/pagesInNs
Umherirrender [Sun, 30 Sep 2018 13:41:19 +0000 (15:41 +0200)]
Fix caller name in SiteStats::numberingroup/pagesInNs

Seeing {closure} in the logs as caller is not helpful

Change-Id: I0102cddc447257319fe8db7f8cbd837838653e99

5 years agoFix caller name in PopulateArchiveRevId::checkMysqlAutoIncrementBug
Umherirrender [Sun, 30 Sep 2018 13:30:16 +0000 (15:30 +0200)]
Fix caller name in PopulateArchiveRevId::checkMysqlAutoIncrementBug

Seeing {closure} in the logs as caller is not helpful

Change-Id: Ie9091805bb4d9c05de93aef065cbbfef56c19e70

5 years agoFix caller name in User::addToDatabase
Umherirrender [Sun, 30 Sep 2018 13:22:29 +0000 (15:22 +0200)]
Fix caller name in User::addToDatabase

Seeing {closure} in the logs as caller is not helpful

Change-Id: I876877046ae4bd1756c13e04892c1381904566de

5 years agoFix caller name in WatchedItemStore::updateNotificationTimestamp
Umherirrender [Sun, 30 Sep 2018 13:06:08 +0000 (15:06 +0200)]
Fix caller name in WatchedItemStore::updateNotificationTimestamp

Seeing {closure} in the logs as caller is not helpful

Change-Id: I13a6632523d0e7e96adf3c9af89c71f38d5342f5

5 years agoFix caller name in ClassicInterwikiLookup::load
Umherirrender [Sun, 30 Sep 2018 11:09:46 +0000 (13:09 +0200)]
Fix caller name in ClassicInterwikiLookup::load

Seeing MediaWiki\Interwiki\{closure} in the logs as caller is not
helpful

Change-Id: I39af68a02d40667e428c7f30c88aacab8a02cd86

5 years agoFix [[MediaWiki:Config-install-success/en]] translation issues
Zoranzoki21 [Fri, 28 Sep 2018 22:37:09 +0000 (01:37 +0300)]
Fix [[MediaWiki:Config-install-success/en]] translation issues

The first sentence in this message should not be splited in two lines.
Too, content of page for FAQ, should be displayed on the user's language.

Bug: T205753
Change-Id: I7b75485411f6b6022bdc773521fbad1366dd8643

5 years agoDeprecate class LegacyFormatter
Max Semenik [Sat, 29 Sep 2018 00:50:10 +0000 (17:50 -0700)]
Deprecate class LegacyFormatter

No uses anywhere, was used by the now removed function wfErrorLog().

Change-Id: Ib4561157e776c64ab17f014fbd8603b0934acb2c

5 years agoMerge "skins: Remove 'usemsgcache' and deprecate getDynamicStylesheetQuery"
jenkins-bot [Sat, 29 Sep 2018 02:05:51 +0000 (02:05 +0000)]
Merge "skins: Remove 'usemsgcache' and deprecate getDynamicStylesheetQuery"

5 years agoMerge "Document some understanding of MessageCache in RawAction/EditPage"
jenkins-bot [Sat, 29 Sep 2018 02:02:04 +0000 (02:02 +0000)]
Merge "Document some understanding of MessageCache in RawAction/EditPage"

5 years agoMerge "Drop wfErrorLog, deprecated in 1.25"
jenkins-bot [Sat, 29 Sep 2018 01:56:53 +0000 (01:56 +0000)]
Merge "Drop wfErrorLog, deprecated in 1.25"

5 years agoMerge "user: Remove use of Message:text() from User::isUsableName()"
jenkins-bot [Sat, 29 Sep 2018 01:49:05 +0000 (01:49 +0000)]
Merge "user: Remove use of Message:text() from User::isUsableName()"

5 years agoDrop wfErrorLog, deprecated in 1.25
James D. Forrester [Thu, 13 Sep 2018 19:57:14 +0000 (12:57 -0700)]
Drop wfErrorLog, deprecated in 1.25

Change-Id: I29131f3c677ab5747ac0ae5121669af63a1d5bd8

5 years agoskins: Remove 'usemsgcache' and deprecate getDynamicStylesheetQuery
Timo Tijhof [Thu, 27 Sep 2018 21:23:48 +0000 (22:23 +0100)]
skins: Remove 'usemsgcache' and deprecate getDynamicStylesheetQuery

For several years now, action=raw urls are automatically purged
after edits, and receive the same cache allowance as page views.

The vast majority of action=raw requests come from the
importScript() function in wikibits.js, which only specififes
'title', 'action' and 'ctype'.

The 'usemsgcache' parameter is a relic (pre-2009) for optimising
something we haven't used in a very long time.  Nothing uses the
'usemsgcache' parameter, except for the one edge-case of
third-party wikis loading Filepage.css from Commons on local
file description pages. This commit removes the handling logic,
in favour of letting the normal Revision-logic happen instead,
which is compatible and produces the same response.

Before 2009, this probably made sense as an optimisation because
we didn't have Revision text cache in Memcached yet at that time,
to avoid DB-load from InstantCommons-based file page views.

The way FileRepo was using it needlessly allowed Filepage.css
to return stale responses (given non-canonical query parameters
variations are not purged on-edit). It also caused responses to
be cached longer or shorter than they should be, due to it being
based on the client wiki's configuration, instead of the repo's
configuration (e.g. Wikimedia Commons). By omitting these
'maxage' parameters, the $wgSquidMaxage config of the repo is
used instead, which makes more sense.

Bug: T193271
Change-Id: Ie52195b56b7f8fc17dec0cbedd6d77968e3bc040

5 years agoDocument some understanding of MessageCache in RawAction/EditPage
Timo Tijhof [Thu, 27 Sep 2018 20:34:39 +0000 (21:34 +0100)]
Document some understanding of MessageCache in RawAction/EditPage

Bug: T193271
Change-Id: I8d110dd7b84faf6b1b64553e8088185de5aac7f2

5 years agouser: Remove use of Message:text() from User::isUsableName()
Timo Tijhof [Sat, 29 Sep 2018 01:01:55 +0000 (02:01 +0100)]
user: Remove use of Message:text() from User::isUsableName()

None of the current translations use of "&", "{" or "[", which
presumably means they don't require tranformation. I'd also
very much prefer such dynamic constructs not be added into
this system which would make it rather unpredictable given these
reserved usernames shouldn't change from time to time.

The only match for the below command is qqq.json,

> $ git grep -E '"(double-redirect-fixer|usermessage-editor|\
> proxyblocker|sorbs|spambot.username|autochange-username)"\
> ' | grep -E '[{&[]'

This code was originally introduced with r37928 (5ad5cb4f0a64),
which used wfMsgForContent() and made no explicit mention of
transformation, it just happened to be the default. Later, when
that function was deprecated, it got batch-replaced by
->inContentLanguage()->text().

Bug: T189966
Change-Id: Ia4ddf215e83f15de552f8311b9e737559c72b49a

5 years agoDon't use deprecated function wfArrayFilterByKey()
Max Semenik [Sat, 29 Sep 2018 00:24:13 +0000 (17:24 -0700)]
Don't use deprecated function wfArrayFilterByKey()

Change-Id: Ifdc67f8b9b8617e6398aa0d2b6ff4bec1e7507ce

5 years agordbms: Document a bunch of stuff about query verbs
Timo Tijhof [Fri, 28 Sep 2018 23:42:43 +0000 (00:42 +0100)]
rdbms: Document a bunch of stuff about query verbs

The decision to treat COMMIT/BEGIN as a "read" in isWriteQuery()
for the benefit of ChronologyProtector was first introduced
in r47360 (8653947b, 2009).

* Re-order strings in isTransactableQuery() to match the regular
  expression in isWriteQuery() for quicker mental comparison

* Add missing visibility to DatabaseSqlite->isWriteQuery, matching
  the parent class implementation.

Bug: T201900
Change-Id: Ic90f6455a2e696ba9428ad5835d0f4be6a0d9a5c

5 years agoMerge "exception: Add FIXME about code duplication"
jenkins-bot [Fri, 28 Sep 2018 23:01:11 +0000 (23:01 +0000)]
Merge "exception: Add FIXME about code duplication"

5 years agoReplace deprecated use of $wgUseTidy in Special:ExpandTemplates
C. Scott Ananian [Thu, 27 Sep 2018 17:33:13 +0000 (13:33 -0400)]
Replace deprecated use of $wgUseTidy in Special:ExpandTemplates

This use managed to escape my notice in
I2e7d990da1da378eb6e828d4b3c0f5a41791dd92.  Note that $wgUseTidy
has actually been false in production since
Idf246d05d116f63a73105b50a1929a7721fbe7b9.

Bug: T175706
Change-Id: I684be210c6efde5b5eb4dca163d45b2701df7555

5 years agoexception: Add FIXME about code duplication
Timo Tijhof [Fri, 28 Sep 2018 21:44:36 +0000 (22:44 +0100)]
exception: Add FIXME about code duplication

These methods aren't identical, so consolidation isn't
immediately obvious, and creating dependencies is problematic
in error handling code given there is a lot of pressure on this
code to not by itself cause additional errors.

This means that maybe it's best to keep these inlined without
duplication, but at the very least we then need to remember
to keep these in sync. This duplication has been around for
a while now, but documentation can never come too late...

Change-Id: I60160f61c13c8e115d839acce222f110e30bc2f2

5 years agoMake messages [[MediaWiki:Config-db-web-account-same/qqq]] and [[MediaWiki:Config...
Zoranzoki21 [Fri, 28 Sep 2018 21:11:39 +0000 (00:11 +0300)]
Make messages [[MediaWiki:Config-db-web-account-same/qqq]] and [[MediaWiki:Config-db-web-create]] clearer

Bug: T205745
Bug: T205749
Change-Id: I511385b6bf64bb7326ac04a07592657a96af9bf3

5 years agoOnly strip newline in OrderedStreamingForkController
Erik Bernhardson [Fri, 28 Sep 2018 17:58:00 +0000 (10:58 -0700)]
Only strip newline in OrderedStreamingForkController

The controller should pass through lines of input exactly as
they were provided, only stripping the trailing newline that
delimits items. The trim was making `door` and `door ` equivilant
but for the use case in search the distinction is important.

Additionally check that the line is actually empty, don't throw
away inputs like '0' which are falsy.

Change-Id: Ifac910543fdb46a27da021e831e3e18befefcfc5

5 years agoMerge "Handle empty revision table in populateArchiveRevId.php"
jenkins-bot [Fri, 28 Sep 2018 15:58:05 +0000 (15:58 +0000)]
Merge "Handle empty revision table in populateArchiveRevId.php"

5 years agoReplace WikiExporter streaming (unbuffered) mode with batched queries
Bill Pirkle [Tue, 11 Sep 2018 22:51:01 +0000 (17:51 -0500)]
Replace WikiExporter streaming (unbuffered) mode with batched queries

WikiExporter allows streaming mode, using unbuffered mode on
the database connection. We are moving away from this technique.
Instead, do multiple normal queries and retrieve the
information in batches.

Bug: T203424
Change-Id: I582240b67c91a8be993a68c23831c9d86617350e

5 years agoMerge "Suggest "apcu" not "apc" in composer.json"
jenkins-bot [Fri, 28 Sep 2018 06:12:50 +0000 (06:12 +0000)]
Merge "Suggest "apcu" not "apc" in composer.json"

5 years agoSuggest "apcu" not "apc" in composer.json
Kunal Mehta [Fri, 28 Sep 2018 05:26:16 +0000 (22:26 -0700)]
Suggest "apcu" not "apc" in composer.json

apc is the pre-PHP 5.5 extension that was partly merged into PHP itself
(the opcode caching), and partly split into a separate apcu extension for
the userland caching. We want people to install apcu for better performance.

Note that we still need to support apc because of HHVM.

Change-Id: I5830a66bc86ff321bf9141d2b65eedb4802e404f

5 years agoBitmapMetadataHandlerTest: Don't reinvent $this->checkPHPExtension()
Kunal Mehta [Fri, 28 Sep 2018 05:01:28 +0000 (22:01 -0700)]
BitmapMetadataHandlerTest: Don't reinvent $this->checkPHPExtension()

Change-Id: I4957ca1be698844bafbf8de64af450cb884ec71a

5 years agoexception: Report uncaught "Catchable" fatal to "fatal" channel
Timo Tijhof [Thu, 27 Sep 2018 23:54:39 +0000 (00:54 +0100)]
exception: Report uncaught "Catchable" fatal to "fatal" channel

Things like "Catchable fatal error: Must be X, null given" stop
execution immediately after the error handler callback, and produce
an HTTP 500 Internal Server Error page. They are very fatal.

Per <https://secure.php.net/manual/en/language.errors.php7.php>,
on PHP 7 this results in a TypeError throwable which will
eventually fatal the request and be reported through
set_exception_handler, or be caught by our top-level 'catch'
and artificially forwarded to our set_exception_handler callback.

On HHVM, these fatal error types are PHP5-like in that they
don't have a throwable object to throw yet, instead the error
meta-data is sent directly as parameeters to set_error_handler,
the same as for warnings. We need to intercept them there so
that they are reported correctly.

Sample from PHP 7:

> MediaWiki\Storage\MutableRevisionRecord::newFromParentRevision( null );
> [no req]   TypeError from line 50 of .../MutableRevisionRecord.php:
> Argument 1 passed to ...\MutableRevisionRecord::newFromParentRevision()
> must be an instance of MediaWiki\Storage\RevisionRecord, null given,
> called in /var/www/mediawiki/maintenance/eval.php(78) ...

[exit status: error(255)]

Sample from HHVM:

> MediaWiki\Storage\MutableRevisionRecord::newFromParentRevision( null );
> [hphp] set_error_handler called with:
> ...  $type = 4096 // E_RECOVERABLE_ERROR
>
> [hphp] [...] Catchable fatal error:
> Argument 1 passed to ...\MutableRevisionRecord::newFromParentRevision()
> must be an instance of MediaWiki\Storage\RevisionRecord, null given
> ...

[exit status: error(255)]

Interestingly, if you forget to return false from set_error_handler
for fatal errors on HHVM, it can actually continue execution.

Bug: T205677
Change-Id: I18dd2ff37fa2c2679d0c598cbeff0c61c2fe0253

5 years agoHandle empty revision table in populateArchiveRevId.php
James Montalvo [Mon, 10 Sep 2018 19:45:37 +0000 (14:45 -0500)]
Handle empty revision table in populateArchiveRevId.php

Running update.php for new wikis without any revisions yet fails when
update.php attempts to run populateArchiveRevId.php. This problem
does not exist if using the web installer or running
maintenance/install.php, since both of these generate a Main Page
revision. Manually generating a MediaWiki database by sourcing
maintenance/tables.sql does not generate any revisions, and thus is
susceptible to this problem.

Bug: T203982

Change-Id: Ifd78c50fb1e11f82340cd83a10fa903b7c5fc1e7

5 years agoUse varargs in global functions
Max Semenik [Fri, 20 Jul 2018 07:10:39 +0000 (00:10 -0700)]
Use varargs in global functions

Change-Id: I1b5509f20ff4903e5063280c4fce4e380055e038

5 years agoMerge "exception: Avoid preg_replace for literal swap"
jenkins-bot [Thu, 27 Sep 2018 19:45:41 +0000 (19:45 +0000)]
Merge "exception: Avoid preg_replace for literal swap"

5 years agoAdd basic test cases for OutputPage::addWikiMsg / wrapWikiMsg
C. Scott Ananian [Thu, 27 Sep 2018 15:05:47 +0000 (11:05 -0400)]
Add basic test cases for OutputPage::addWikiMsg / wrapWikiMsg

Change-Id: I621c22f2819b426ce6088ff3bdf1dadca274d1f9

5 years agoRemove temporary rcfilters variables
Stephane Bisson [Thu, 27 Sep 2018 17:09:33 +0000 (13:09 -0400)]
Remove temporary rcfilters variables

wgStructuredChangeFiltersShowPreference, wgStructuredChangeFiltersShowWatchlistPreference,
and wgStructuredChangeFiltersOnWatchlist were introduced for progressive rollout
of the RCFilters app on RC and WL.

These variables and their related conditional code is no longer needed.

Bug: T196033
Change-Id: Id3799fefd21cd9bea0e089a5e12576ee9ea1085e

5 years agoMerge "Special:NewFiles - ensure top text is entirely wrapped"
jenkins-bot [Thu, 27 Sep 2018 17:11:12 +0000 (17:11 +0000)]
Merge "Special:NewFiles - ensure top text is entirely wrapped"

5 years agoexception: Avoid preg_replace for literal swap
Timo Tijhof [Thu, 27 Sep 2018 16:04:48 +0000 (17:04 +0100)]
exception: Avoid preg_replace for literal swap

Follows-up bbcbcaba3db9.

Change-Id: Ie7b76c28ba53668d73a8435c4d2ec91757bd2372

5 years agoSpecial:Import - wrap error messages with <div> not <p>
C. Scott Ananian [Thu, 27 Sep 2018 14:16:53 +0000 (10:16 -0400)]
Special:Import - wrap error messages with <div> not <p>

Localized messages are wikitext and can contain `<div>` or `\n\n` which
would break `<p>` wrappers.  Be consistent with the rest of the codebase
and use `<div>` wrappers here.

Bug: T205624
Change-Id: I1e8ff5985f3a7780ad9ba063827c515e997cb508

5 years agoSpecial:NewFiles - ensure top text is entirely wrapped
C. Scott Ananian [Thu, 27 Sep 2018 13:24:15 +0000 (09:24 -0400)]
Special:NewFiles - ensure top text is entirely wrapped

The template on commons for newimagestext has a <div> wrapper,
and trying to wrap a <p> around a <div> doesn't work: the <p> is
implicitly closed by the start of the <div>.  Use a <div> wrapper
to set the content language and directionality instead, which ensures
that it is valid HTML and will be tidied correctly.

In the process, fix an extra argument (and unnecessary optional argument)
passed to OutputPage::addWikiTextTidy in
Ife33ceed39ed01d4e9af18e9108026f341e9b343.

Bug: T205624
Change-Id: I42d198e6d03afd5b976da741f235c175bfe9f767

5 years agoMerge "copyedit patch-parsercache.sql comment"
jenkins-bot [Thu, 27 Sep 2018 00:29:09 +0000 (00:29 +0000)]
Merge "copyedit patch-parsercache.sql comment"

5 years agocopyedit patch-parsercache.sql comment
Reedy [Wed, 26 Sep 2018 21:36:24 +0000 (22:36 +0100)]
copyedit patch-parsercache.sql comment

Change-Id: Ie0a9d9dc11bd6944cabd30952fa836745e3f22b9

5 years agoMerge "Parser: Refactor parsing of [[File:...|link=...]] syntax for reusability"
jenkins-bot [Wed, 26 Sep 2018 19:18:34 +0000 (19:18 +0000)]
Merge "Parser: Refactor parsing of [[File:...|link=...]] syntax for reusability"

5 years agoMerge "Rephrase 'imagemaxsize' message (used on preferences)"
jenkins-bot [Wed, 26 Sep 2018 16:04:45 +0000 (16:04 +0000)]
Merge "Rephrase 'imagemaxsize' message (used on preferences)"