lhc/web/wiklou.git
3 years agoSECURITY: Don't exclude .htaccess files from `git archive`
Kunal Mehta [Fri, 20 Jul 2018 20:29:14 +0000 (22:29 +0200)]
SECURITY: Don't exclude .htaccess files from `git archive`

Bug: T199029
Change-Id: I7ada3dddc4f5f7f2800882ccc9c73c8494f7fac9

3 years agoSECURITY: Do not allow botpassword login if account locked.
Brian Wolff [Sun, 13 May 2018 19:37:09 +0000 (19:37 +0000)]
SECURITY: Do not allow botpassword login if account locked.

Reported by Rxy

Bug: T194605
Change-Id: Ib41005e69ab4db6f849837de12f0d41398b58f9a

3 years agoSECURITY: Make 'newbie' limit in $wgRateLimits really override 'user' limit
Chad Horohoe [Tue, 13 Mar 2018 18:43:30 +0000 (18:43 +0000)]
SECURITY: Make 'newbie' limit in $wgRateLimits really override 'user' limit

The order of operations was incorrect.

Bug: T169545
Change-Id: Ia910aa2a494914d3b0017daac9ab294ea9fa8705

3 years agoMerge "Soft deprecate non-Remex tidy configurations"
jenkins-bot [Thu, 20 Sep 2018 20:34:31 +0000 (20:34 +0000)]
Merge "Soft deprecate non-Remex tidy configurations"

3 years agoMerge "Hard-deprecate the $wgUseTidy option"
jenkins-bot [Thu, 20 Sep 2018 20:29:00 +0000 (20:29 +0000)]
Merge "Hard-deprecate the $wgUseTidy option"

3 years agoMerge "Use wfIsHHVM() instead of a HipHop-specific environment variable"
jenkins-bot [Thu, 20 Sep 2018 18:19:27 +0000 (18:19 +0000)]
Merge "Use wfIsHHVM() instead of a HipHop-specific environment variable"

3 years agoSoft deprecate non-Remex tidy configurations
C. Scott Ananian [Tue, 26 Jun 2018 13:58:47 +0000 (09:58 -0400)]
Soft deprecate non-Remex tidy configurations

Future parsers will not be able to emit output compatible with these
configurations.

Bug: T198214
Change-Id: Id7921a166a62457f289e6c0c4bba6c8563be4760

3 years agoHard-deprecate the $wgUseTidy option
C. Scott Ananian [Tue, 26 Jun 2018 13:35:26 +0000 (09:35 -0400)]
Hard-deprecate the $wgUseTidy option

This has been soft-deprecated since MW 1.26; this hard-deprecation
sets the stage for future removal of this old cruft.

Bug: T198214
Depends-On: Idf246d05d116f63a73105b50a1929a7721fbe7b9
Change-Id: I2e7d990da1da378eb6e828d4b3c0f5a41791dd92

3 years agoUse wfIsHHVM() instead of a HipHop-specific environment variable
C. Scott Ananian [Thu, 20 Sep 2018 13:21:47 +0000 (09:21 -0400)]
Use wfIsHHVM() instead of a HipHop-specific environment variable

Change-Id: I5bbf3e4f65d9b6a0d7419f67e3931e77e92b7e6c

3 years agoMerge "Set break-word on figcaption"
jenkins-bot [Thu, 20 Sep 2018 12:55:37 +0000 (12:55 +0000)]
Merge "Set break-word on figcaption"

3 years agoMerge "resourceloader: Simplify StringSet fallback"
jenkins-bot [Thu, 20 Sep 2018 07:58:03 +0000 (07:58 +0000)]
Merge "resourceloader: Simplify StringSet fallback"

3 years agoMerge "resourceloader: Use null-objects for 'sources' and 'registry'"
jenkins-bot [Thu, 20 Sep 2018 07:57:58 +0000 (07:57 +0000)]
Merge "resourceloader: Use null-objects for 'sources' and 'registry'"

3 years agoMerge "resourceloader: Minor clean up in mw.loader and mw.html"
jenkins-bot [Thu, 20 Sep 2018 07:42:30 +0000 (07:42 +0000)]
Merge "resourceloader: Minor clean up in mw.loader and mw.html"

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 20 Sep 2018 07:14:17 +0000 (09:14 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ifab02635d866e244cff2ab4eecccdc70119e413a

3 years agoDefine which languages explicitly fallback to 'en'
Ed Sanders [Tue, 3 Apr 2018 21:08:52 +0000 (22:08 +0100)]
Define which languages explicitly fallback to 'en'

In the message store, all messages fall through to English,
but only a few languages should actually explicitly fallback
to English (English variants and dialects).

These new explicit fallbacks are used by ResourceLoaderImageModule,
and this change doesn't affect the message fall through system.

Bug: T203350
Change-Id: I6b68a17f4d69341bccdae748727b5133a600d8bc

3 years agoMerge "Add MessagesBi.php"
jenkins-bot [Wed, 19 Sep 2018 22:45:03 +0000 (22:45 +0000)]
Merge "Add MessagesBi.php"

3 years agoMerge "Add MessagesSco.php"
jenkins-bot [Wed, 19 Sep 2018 21:51:33 +0000 (21:51 +0000)]
Merge "Add MessagesSco.php"

3 years agoMerge "mw.jqueryMsg: Handle non-string parameters to functions that expect strings...
jenkins-bot [Wed, 19 Sep 2018 19:08:46 +0000 (19:08 +0000)]
Merge "mw.jqueryMsg: Handle non-string parameters to functions that expect strings better"

3 years agoMerge "mw.jqueryMsg: Add tests for non-string parameters to functions that expect...
jenkins-bot [Wed, 19 Sep 2018 19:08:40 +0000 (19:08 +0000)]
Merge "mw.jqueryMsg: Add tests for non-string parameters to functions that expect strings"

3 years agoMerge "Special:Preferences: Remove unnecessary OOUI styles override"
jenkins-bot [Wed, 19 Sep 2018 18:53:14 +0000 (18:53 +0000)]
Merge "Special:Preferences: Remove unnecessary OOUI styles override"

3 years agoMerge "resourceloader: Add internal RLPAGEMODULES constant"
jenkins-bot [Wed, 19 Sep 2018 18:40:36 +0000 (18:40 +0000)]
Merge "resourceloader: Add internal RLPAGEMODULES constant"

3 years agoMerge "resourceloader: Make ResourceLoader::makeLoaderRegisterScript() internal"
jenkins-bot [Wed, 19 Sep 2018 18:33:34 +0000 (18:33 +0000)]
Merge "resourceloader: Make ResourceLoader::makeLoaderRegisterScript() internal"

3 years agoMerge "resourceloader: Factor out encodeJsonForScript"
jenkins-bot [Wed, 19 Sep 2018 18:33:29 +0000 (18:33 +0000)]
Merge "resourceloader: Factor out encodeJsonForScript"

3 years agoSpecial:Preferences: Remove unnecessary OOUI styles override
Bartosz Dziewoński [Wed, 19 Sep 2018 18:00:28 +0000 (20:00 +0200)]
Special:Preferences: Remove unnecessary OOUI styles override

Since OOUI v0.24.4, menus/popups of infused PHP widgets are placed
into the default overlay, so this workaround is not needed.

Change-Id: I4f8a76cb258e44ed4f2fbba41425100d2e0e9b45

3 years agoMerge "StructureTest::testUnitTestFileNamesEndWithTest() should not shell out"
jenkins-bot [Wed, 19 Sep 2018 17:37:55 +0000 (17:37 +0000)]
Merge "StructureTest::testUnitTestFileNamesEndWithTest() should not shell out"

3 years agoMerge "Use new isTalkPage/isTalkNamespace methods"
jenkins-bot [Wed, 19 Sep 2018 17:20:53 +0000 (17:20 +0000)]
Merge "Use new isTalkPage/isTalkNamespace methods"

3 years agoMerge "DateInputWidget: Update OOUI variables to latest"
jenkins-bot [Wed, 19 Sep 2018 17:14:24 +0000 (17:14 +0000)]
Merge "DateInputWidget: Update OOUI variables to latest"

3 years agoMerge "DateTimeInputWidget: Rename vars to reflect latest WikimediaUI theme vars"
jenkins-bot [Wed, 19 Sep 2018 17:10:17 +0000 (17:10 +0000)]
Merge "DateTimeInputWidget: Rename vars to reflect latest WikimediaUI theme vars"

3 years agoMerge "Special:Preferences: Reduce PanelLayout border contrast slightly"
jenkins-bot [Wed, 19 Sep 2018 17:10:12 +0000 (17:10 +0000)]
Merge "Special:Preferences: Reduce PanelLayout border contrast slightly"

3 years agoUse new isTalkPage/isTalkNamespace methods
Ed Sanders [Thu, 13 Sep 2018 18:43:04 +0000 (19:43 +0100)]
Use new isTalkPage/isTalkNamespace methods

Change-Id: I291738ff6ebb63df2e405e98131dd80f3ddf2db6

3 years agoSpecial:Preferences: Reduce PanelLayout border contrast slightly
Volker E [Wed, 19 Sep 2018 16:13:14 +0000 (09:13 -0700)]
Special:Preferences: Reduce PanelLayout border contrast slightly

The border choice for `#a2a9b1` was intended to provide AA conforming
contrast for widgets. In case of framed PanelLayout it is not necessary
due to it's different use case and the additional high padding.

Change-Id: Ia425594c1795d1d8668cd62daff32ff9b97d67c2

3 years agoMerge "resourceloader: Remove check for Function#bind and Object.defineProperty"
jenkins-bot [Wed, 19 Sep 2018 15:43:31 +0000 (15:43 +0000)]
Merge "resourceloader: Remove check for Function#bind and Object.defineProperty"

3 years agoMerge "Avoid ResourceLoader LESS parsing bug"
jenkins-bot [Wed, 19 Sep 2018 15:33:58 +0000 (15:33 +0000)]
Merge "Avoid ResourceLoader LESS parsing bug"

3 years agoresourceloader: Remove check for Function#bind and Object.defineProperty
Timo Tijhof [Sat, 15 Sep 2018 18:46:51 +0000 (19:46 +0100)]
resourceloader: Remove check for Function#bind and Object.defineProperty

* Function#bind is a given per the explicit feature test for Grade A.
* Object.defineProperty is part of ES5 which is also tested for.

This code is from before we required ES5 and is now redundant.

Also remove the unused eslint-disable rule for global 'console' use,
the code in question does not use console as global unconditionally.

Change-Id: I6c77b25856da8b7717aeba8298b17a9231540d58

3 years agoAvoid ResourceLoader LESS parsing bug
Ed Sanders [Wed, 19 Sep 2018 11:16:56 +0000 (12:16 +0100)]
Avoid ResourceLoader LESS parsing bug

Bug: T204816
Change-Id: I4558e2c05dd3377090de11aa79f20911fa3365eb

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 19 Sep 2018 07:28:39 +0000 (09:28 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I383c3794e40e4269c1f8ddcc60ddf1bc202b5eff

3 years agoDateTimeInputWidget: Rename vars to reflect latest WikimediaUI theme vars
Volker E [Wed, 19 Sep 2018 00:33:29 +0000 (17:33 -0700)]
DateTimeInputWidget: Rename vars to reflect latest WikimediaUI theme vars

Change-Id: Icdae37127633e7fb17f77550d4900addf076cbfd

3 years agoDateInputWidget: Update OOUI variables to latest
Volker E [Tue, 18 Sep 2018 23:59:51 +0000 (16:59 -0700)]
DateInputWidget: Update OOUI variables to latest

In course of icon overhaul we've also unified base widget font-size
to `14px` in I693d168d2ccf2. DateInputWidget has been left behind.
Let's amend it and also align other variables like
`transition-medium`.

Change-Id: I033bfa17b665d7e36f6d18c3adfa0315c4b26cb0

3 years agoMerge "mediawiki.util: Optimise addPortletLink"
jenkins-bot [Tue, 18 Sep 2018 21:41:32 +0000 (21:41 +0000)]
Merge "mediawiki.util: Optimise addPortletLink"

3 years agoMerge "mediawiki.util: Improve unit tests"
jenkins-bot [Tue, 18 Sep 2018 21:30:47 +0000 (21:30 +0000)]
Merge "mediawiki.util: Improve unit tests"

3 years agomediawiki.util: Optimise addPortletLink
Timo Tijhof [Tue, 18 Sep 2018 02:15:07 +0000 (03:15 +0100)]
mediawiki.util: Optimise addPortletLink

* Use prop() instead of attr().
  - Avoids extra overhead from attr() relating to XML/SVG compat.
  - Makes the code consistent with jquery.accessKeyLabel, which,
    reads the node.accessKey value as property already, and we now
    set it the same way.

* Use append() instead of wrap().parent().
  Most use of adding portlets is as links in the sidebar or
  as menu items for the page actions menu. For this, simply
  assign the <li> directly, and append the link. Instead of
  wrapping it in the DOM and then unwrapping the jQuery
  collection. This also saves a bunch of clone operations
  internally due to how jQuery objects keep a stack of
  mutations.

* Set 'textContent' directly instead of text().

* Use $('<li>') instead of $().wrap('<li></li>') which allows jQuery
  to take a fast path for element creation. Also consistent with
  MW code conventions which say to avoid <tag></tag>.

* Use node.querySelector(str) instead of $(node).find(str).eq(0).
  The latter does a lot more, including querySelectorAll(),
  and twice a clone/push/merge of the jQuery collection.

* Use createElement() for the anchor tag, given that none of the
  remaining code needed the jQuery object anymore. The return
  value was already the DOM Node directly as well.

Bug: T204625
Change-Id: I9070f63a4c75411c0eff7757bd2d8aed46c182e9

3 years agoStructureTest::testUnitTestFileNamesEndWithTest() should not shell out
Umherirrender [Sun, 16 Sep 2018 19:44:42 +0000 (21:44 +0200)]
StructureTest::testUnitTestFileNamesEndWithTest() should not shell out

Bug: T169005
Change-Id: I17b35f31c3989ca0b9056252866a45434c31a105

3 years agoSpecial:Preferences: Enable OOUI mode by default
James D. Forrester [Tue, 18 Sep 2018 18:29:38 +0000 (11:29 -0700)]
Special:Preferences: Enable OOUI mode by default

Developers and other users can temporarily still opt out with ?ooui=0.

Bug: T117781
Change-Id: I1466e67161b5155552ffa7d80c383064913ec4dc

3 years agoUse "Unknown user" instead of an empty user name.
daniel [Mon, 28 May 2018 19:19:11 +0000 (21:19 +0200)]
Use "Unknown user" instead of an empty user name.

This changes the user name to "User unknown" when constructing a RevisionRecord
from a database row that has an empty ar_user_text resp rev_user_text field.

This may cause "User unknown" to be written to the database, if the
RevisionRecord is used as the basis for a new revision that is being created,
particularly during undeletion. Since "Unknown user" is listed in
$wgReservedUsernames, this should never lead to conflicts with actual user
names.

It is assumed that empty ar_user_text and rev_user_text fields will be
fixed during migration to the new actor based database schema.

Bug: T195692
Change-Id: I506c513b019778d83741e47f0d11093f5ab67a54

3 years agoWatchedItemStore::countVisitingWatchersMultiple() shouldn't query all titles when...
Brad Jorsch [Tue, 18 Sep 2018 16:01:32 +0000 (12:01 -0400)]
WatchedItemStore::countVisitingWatchersMultiple() shouldn't query all titles when asked for none

If a caller gives an empty array for $targetsWithVisitThresholds, per
the documentation it should be expecting an empty array in return, not a
count of watchers for every title in the database.

Bug: T204729
Change-Id: I0f25fae301450d077bb30597281aaef0fba209d4

3 years agoMerge "Allow edit.php to modify different slots."
jenkins-bot [Tue, 18 Sep 2018 15:52:02 +0000 (15:52 +0000)]
Merge "Allow edit.php to modify different slots."

3 years agoMerge "mediawiki.Title: Add isTalkPage/getTalkPage methods to mw.Title.js"
jenkins-bot [Tue, 18 Sep 2018 15:00:30 +0000 (15:00 +0000)]
Merge "mediawiki.Title: Add isTalkPage/getTalkPage methods to mw.Title.js"

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 18 Sep 2018 07:14:02 +0000 (09:14 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: If4369a94a3165a063ccc3061a6f3a5e6e6487ad5

3 years agomediawiki.util: Improve unit tests
Timo Tijhof [Tue, 18 Sep 2018 02:59:08 +0000 (03:59 +0100)]
mediawiki.util: Improve unit tests

* Simplify fixture.
* Use more obvious example values.
* Add strict test for nodeType and nodeName on the return value.
  Previously it was only asserting the return value to be a Node,
  now it asserts it to be an html anchor element.
* Improve wording of some assertion messages.
* Line breaks.

Bug: T204625
Change-Id: I75442a4d86ac328410f0f7bc9976a2316f00cf95

3 years agoMerge "Article: Fix reference to view() in documentation comment"
jenkins-bot [Tue, 18 Sep 2018 02:26:10 +0000 (02:26 +0000)]
Merge "Article: Fix reference to view() in documentation comment"

3 years agoArticle: Fix reference to view() in documentation comment
Roan Kattouw [Tue, 18 Sep 2018 01:29:55 +0000 (21:29 -0400)]
Article: Fix reference to view() in documentation comment

WikiPage::view() doesn't exist; Article::view() does.

Change-Id: I3fbffa15be4cff6cb3f5c7dc5cc178102472f25b

3 years agoresourceloader: Add internal RLPAGEMODULES constant
Timo Tijhof [Mon, 17 Sep 2018 23:48:14 +0000 (00:48 +0100)]
resourceloader: Add internal RLPAGEMODULES constant

Expose this constant for internal use by Navigation Timing,
so that it can compute mwLoadEnd based on when these modules
finish loading.

The way mwLoadEnd is currently computed is by building a list
of all registered module names, and narrowing it down to the
ones in 'loading' state at the time that ext.navigationTiming.js
executes. The problem with doing that, is that it is includes
various lazy-loaded modules that aren't critical to the page and
aren't meant to be tracked by that metric. For example:

* Preloading of modules from various extensions (including VE,
  and Popups).
* Background chains for EventLogging schemas from mw.loader.using,
  including the one started by Navigation Timing itself.
  On my local install, the list of filtered down modules always
  includes 'schema.SaveTiming', '...rumSpeedIndex', etc.

Exporting the list passed to the initial load() call as constant
will enable Navigation Timing to instead only await only those
modules (and their dependneices).

Bug: T204426
Change-Id: Ida134b4dfee218db16c2d1f88d4f26e8d761e154

3 years agoresourceloader: Make ResourceLoader::makeLoaderRegisterScript() internal
Timo Tijhof [Sat, 15 Sep 2018 21:31:18 +0000 (22:31 +0100)]
resourceloader: Make ResourceLoader::makeLoaderRegisterScript() internal

* There is only a single non-test caller to this method in the entire
  codebase, and no callers elsewhere (Wikimedia Git, Codesearch).

  It's only used with an array, so remove the other unused code paths,
  and mark it internal (to my knowledge, nothing ever used it outside
  RL in the past, either).

* Add test coverage for the module indexing logic.

Change-Id: I9e0f95416d5b2fdd87323288231ee6d8c85d88e7

3 years agoresourceloader: Factor out encodeJsonForScript
Timo Tijhof [Sat, 15 Sep 2018 20:51:43 +0000 (21:51 +0100)]
resourceloader: Factor out encodeJsonForScript

Follows-up dc3fc6cf81, which documented the reasoning for the
specific json flags in StartupModule. In wanting to re-use them
in a different module it became apparant that perhaps it was a
bit too conservative in only allowing the flags to be used in
a script HTTP response.

Lax the contract a little bit (that is, do more escaping) to also
allow safe re-use in HTML context.

I considered making these separate methods (e.g. forScriptResponse,
and forInlineScript) but decided not to because the vast majority
of callers would have to be forInlineScript eventhough the code
in question had no responsiblity or knowledge of it becoming an
inline script, because ResourceLoader allows most modules to
become embedded if they support a private or preview mode.

Those modes are implemented by calling makeModuleResponse, and
wrapping it an inline script. It seems appealing and simplifying
to the API to require that script output is always safe for
embedding rather than complicating the API for winning back
a literal handful of bytes in the edge case that a user-generated
string contains a '<' and was not embedded. I estimate that with
gzip, it will literally save only a single byte, even if used
multiple times. Let's focus optimisation efforts elsewhere :)

Change-Id: I7742dabba6750deecf6fbf51cf9a77ee8cbfc727

3 years agoMerge "Handle invalid input to Special:FilePath?file="
jenkins-bot [Mon, 17 Sep 2018 21:03:36 +0000 (21:03 +0000)]
Merge "Handle invalid input to Special:FilePath?file="

3 years agomediawiki.Title: Add isTalkPage/getTalkPage methods to mw.Title.js
Ed Sanders [Thu, 13 Sep 2018 18:21:30 +0000 (19:21 +0100)]
mediawiki.Title: Add isTalkPage/getTalkPage methods to mw.Title.js

These are identical to methods in Title.php

Change-Id: Ie57243bac1aa5e23bc8b1c027bcb1b83090ee433

3 years agoMerge "resourceloader: Remove unused makeCustomLoaderScript() method"
jenkins-bot [Mon, 17 Sep 2018 18:44:42 +0000 (18:44 +0000)]
Merge "resourceloader: Remove unused makeCustomLoaderScript() method"

3 years agoMerge "resources: Strip '$' and 'mw' from file closures"
jenkins-bot [Mon, 17 Sep 2018 18:41:32 +0000 (18:41 +0000)]
Merge "resources: Strip '$' and 'mw' from file closures"

3 years agoMerge "ApiQueryInfo: fix query limits for testactions"
jenkins-bot [Mon, 17 Sep 2018 14:06:26 +0000 (14:06 +0000)]
Merge "ApiQueryInfo: fix query limits for testactions"

3 years agoMerge "Introduce ContentHandler::getSecondaryDataUpdates."
jenkins-bot [Mon, 17 Sep 2018 14:06:19 +0000 (14:06 +0000)]
Merge "Introduce ContentHandler::getSecondaryDataUpdates."

3 years agoApiQueryInfo: fix query limits for testactions
Bartek Łukawski [Mon, 17 Sep 2018 11:23:36 +0000 (13:23 +0200)]
ApiQueryInfo: fix query limits for testactions

ApiBase::LIMIT_SML2 actually belongs to apihighlimits.

Change-Id: Iaa50c6be417c9681563087b80928dc49a3bbd141

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 17 Sep 2018 07:42:12 +0000 (09:42 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I4c16ddd26f216b8394faf2fdec0a0efe10d1e6bd

3 years agoHandle invalid input to Special:FilePath?file=
Umherirrender [Sat, 18 Aug 2018 00:39:36 +0000 (02:39 +0200)]
Handle invalid input to Special:FilePath?file=

Bug: T175301
Change-Id: I38a05416db10de88f3bc529f5fad9697d7d6e1c2

3 years agoMerge "Give more specific error messages on Special:Redirect"
jenkins-bot [Sun, 16 Sep 2018 19:40:32 +0000 (19:40 +0000)]
Merge "Give more specific error messages on Special:Redirect"

3 years agoGive more specific error messages on Special:Redirect
Umherirrender [Sat, 18 Aug 2018 02:37:59 +0000 (04:37 +0200)]
Give more specific error messages on Special:Redirect

Added some basic tests

Bug: T202183
Change-Id: Ib0dd50ff5575a2b2093a57afce79e9f8623fa24d

3 years agoMerge "build: Updating mediawiki/mediawiki-codesniffer to 22.0.0"
jenkins-bot [Sun, 16 Sep 2018 16:13:55 +0000 (16:13 +0000)]
Merge "build: Updating mediawiki/mediawiki-codesniffer to 22.0.0"

3 years agoMerge "Ensure database is setup in MediaWikiTestCase::insertPage"
jenkins-bot [Sun, 16 Sep 2018 15:53:28 +0000 (15:53 +0000)]
Merge "Ensure database is setup in MediaWikiTestCase::insertPage"

3 years agobuild: Updating mediawiki/mediawiki-codesniffer to 22.0.0
Umherirrender [Fri, 7 Sep 2018 17:01:32 +0000 (19:01 +0200)]
build: Updating mediawiki/mediawiki-codesniffer to 22.0.0

Added spaces around .
Removed empty return statement which are not required
Removed return after phpunit markTestIncomplete,
which is throwing to exit the test, no need for a return

Change-Id: I2c80b965ee52ba09949e70ea9e7adfc58a1d89ce

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 16 Sep 2018 07:58:34 +0000 (09:58 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ic31e0d5aef1fc08989f8d39b32a858257f43c2ef

3 years agoresourceloader: Remove unused makeCustomLoaderScript() method
Timo Tijhof [Sat, 15 Sep 2018 21:13:37 +0000 (22:13 +0100)]
resourceloader: Remove unused makeCustomLoaderScript() method

Follows-up a0809dfa5 (2015) which removed the feature for which
this would be used. No callers in MediaWiki core, Wikimedia Git,
or elsewhere indexed by Codesearch.

Bug: T65240
Change-Id: I56af8df3d072cd76a38595254812af6be268b134

3 years agoresourceloader: Simplify StringSet fallback
Timo Tijhof [Sat, 15 Sep 2018 18:38:22 +0000 (19:38 +0100)]
resourceloader: Simplify StringSet fallback

Covered by tests.

Change-Id: I6a287f27d0830561275bf0be525992c59cbe441f

3 years agoresourceloader: Use null-objects for 'sources' and 'registry'
Timo Tijhof [Sat, 15 Sep 2018 17:54:19 +0000 (18:54 +0100)]
resourceloader: Use null-objects for 'sources' and 'registry'

Follows-up e5912535aea, and removes the last use of
Object.prototype-inheriting objects for map-like objects, in
mediawiki.js.

I'd like to consider using ES6 Map as well, with a partial shim
like we do for StringSet/Set, but that'll require some more
refactoring. It's also not clear whether it will improve
execution speed and/or memory use. Worth trying at a later time,
though.

The current change simply removes the inheritance and simplifies
the code. Apart from slightly smaller code, I could not find any
notable/reproducible improvement in either NavTiming metrics or
CPU time spent in 'Scripting'. The metrics are in the same range
as before this changes.

Change-Id: Ie0016667d9291dcfafde61289d5444817be3447d

3 years agoresourceloader: Minor clean up in mw.loader and mw.html
Timo Tijhof [Sat, 15 Sep 2018 17:45:50 +0000 (18:45 +0100)]
resourceloader: Minor clean up in mw.loader and mw.html

* Remove redundant registry check in the internal
  queueModuleScript function. Like most internal methods,
  it can only be inside the mw.loader closure, and is only
  called with extant module name.

* Remove redundant registry check from execute().

* Rename local variable in mw.loader.state() from 'modules'
  to 'states' to avoid confusion.

* Shorten exception messages in mw.html to not prefix the method
  names, because we don't do that anywhere else in RL JS.

Change-Id: Idf1a49fd98445477f2d940624ca0d079325bd15b

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 15 Sep 2018 07:28:35 +0000 (09:28 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I13ddf57c93ab420c882f38e353898715f5770e60

3 years agoMerge "remove outdated design.txt."
jenkins-bot [Sat, 15 Sep 2018 00:30:41 +0000 (00:30 +0000)]
Merge "remove outdated design.txt."

3 years agoMerge "Release notes for MCR baseline"
jenkins-bot [Fri, 14 Sep 2018 21:30:07 +0000 (21:30 +0000)]
Merge "Release notes for MCR baseline"

3 years agoEnsure database is setup in MediaWikiTestCase::insertPage
Umherirrender [Fri, 14 Sep 2018 18:30:30 +0000 (20:30 +0200)]
Ensure database is setup in MediaWikiTestCase::insertPage

Also in editPage
Add missing @group Database

Depends-On: Id81425fff0a41c651c1967698124246befcdb032
Depends-On: If97d9e6e525465ca3879003e71dd5e67fc0afdfd
Change-Id: I3bfd478769e0907913834c9639af4375223638cc

3 years agoMerge "Give search results a consistent css class to select"
jenkins-bot [Fri, 14 Sep 2018 19:40:07 +0000 (19:40 +0000)]
Merge "Give search results a consistent css class to select"

3 years agoRelease notes for MCR baseline
daniel [Fri, 14 Sep 2018 13:43:18 +0000 (15:43 +0200)]
Release notes for MCR baseline

Change-Id: I6a9ae5642f6a39c5f35cab8c49d6636311288eb9

3 years agoIntroduce ContentHandler::getSecondaryDataUpdates.
daniel [Fri, 9 Mar 2018 22:05:47 +0000 (23:05 +0100)]
Introduce ContentHandler::getSecondaryDataUpdates.

This adds getSecondaryDataUpdates and getDeletionUpdates
to ContentHandler, and updates WikiPage and DerivedPageDataUpdates
to handle DataUpdates from all slots.

Bug: T194038
Bug: T194037
Change-Id: I75c96318f58a5cdda48484f7040ae41e6f42392a

3 years agoremove outdated design.txt.
daniel [Fri, 14 Sep 2018 14:08:02 +0000 (16:08 +0200)]
remove outdated design.txt.

While having an overview of the overall design of MediaWiki in the
code repository is a good thing, having an outdated design overview
that has not been substantially updated in 15 years is not helpful.

This is a fun historical document though, so I have put it up at
<https://www.mediawiki.org/wiki/Architecture/design.txt>.

Change-Id: I85be15a68f4ab9ac77766112e6484f2007da4eec

3 years agoAllow edit.php to modify different slots.
daniel [Fri, 14 Sep 2018 09:20:12 +0000 (11:20 +0200)]
Allow edit.php to modify different slots.

This adds --slot and --remove options to the edit.php maintenance script,
to allow content of different slots to be edited, alots to be added, and
slots to be removed.

This is needed to help with testing MCR functionality, since EditPage
does not yet support MCR.

Bug: T189220
Change-Id: I985fb5afcd5d469fc31b32d2a927f425c40fc290

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 14 Sep 2018 07:22:43 +0000 (09:22 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I0d24aaefa10d74d6ed44ac77e3fe92003b4d766d

3 years agoMerge "Drop wfUseMW, deprecated in 1.26"
jenkins-bot [Fri, 14 Sep 2018 01:53:07 +0000 (01:53 +0000)]
Merge "Drop wfUseMW, deprecated in 1.26"

3 years agoMerge "mediawiki.language: Use the 'mw' global"
jenkins-bot [Fri, 14 Sep 2018 01:40:56 +0000 (01:40 +0000)]
Merge "mediawiki.language: Use the 'mw' global"

3 years agoDrop wfUseMW, deprecated in 1.26
James D. Forrester [Thu, 13 Sep 2018 19:58:58 +0000 (12:58 -0700)]
Drop wfUseMW, deprecated in 1.26

Change-Id: I291d6eace1913a651c5e7136f3f2e0216d89fac5

3 years agoMerge "mediawiki.language: Remove unused private method 'procPLURAL'"
jenkins-bot [Fri, 14 Sep 2018 00:34:05 +0000 (00:34 +0000)]
Merge "mediawiki.language: Remove unused private method 'procPLURAL'"

3 years agoresources: Strip '$' and 'mw' from file closures
Timo Tijhof [Wed, 29 Aug 2018 04:46:30 +0000 (05:46 +0100)]
resources: Strip '$' and 'mw' from file closures

Follows-up Id6d13bbea6:
- '$': mw.loader.implement does this already.
- 'mw': Use the canonical name directly.

This replaces the following patterns:

File closures (common):
- `( function ( $, mw ) {`     => `( function () {`
- `( function ( $ ) {`         => `( function () {`
- `( function ( mw ) {`        => `( function () {`
- `( function ( mw, $ ) {`     => `( function () {`

File closures (rare):
- `( function ( mw, $, OO ) {`    => `( function () {`
- `( function ( mw, OO, $ ) {`    => `( function () {`
- `( function ( mw, document ) {` => `( function () {`

Combined dom-ready and file closure (rare):
- `jQuery( function ( $ ) {` => `$( function () {
- `jQuery( function () {` => `$( function () {

Remaining references in files without a closure, as found by
the new ESLint setting (rare):
- `jQuery`    => `$`
- `mediaWiki` => `mw`

Change-Id: I7cf2426cde597259e8c6f3f6f615a1a81a0ca82b

3 years agomediawiki.language: Use the 'mw' global
Timo Tijhof [Thu, 13 Sep 2018 23:48:42 +0000 (00:48 +0100)]
mediawiki.language: Use the 'mw' global

Follows-up Id6d13bbea6.

Change-Id: I16de5ef6190aa4bb322b03416d51bbf28ff15dc9

3 years agoMerge "resourceloader: Optimise and simplify state propagation logic"
jenkins-bot [Thu, 13 Sep 2018 23:40:28 +0000 (23:40 +0000)]
Merge "resourceloader: Optimise and simplify state propagation logic"

3 years agoresourceloader: Optimise and simplify state propagation logic
Timo Tijhof [Sat, 8 Sep 2018 20:04:17 +0000 (21:04 +0100)]
resourceloader: Optimise and simplify state propagation logic

aka "handlePending 2.0",
aka "don't recurse 300x before executing a module",
aka "don't break DevTools flame graphs".

== Impact

Comparison based on viewing the default Main page on Chrome stable.
The local MediaWiki has a few extensions installed (EventLogging,
ULS, Navigation Timing).

Measured by alternating between before/after and logging 'mediaWikiLoadEnd'
from ext.navigationTiming.js, and evaluating the following on the console:
```
({ responseStart: performance.timing.responseStart - performance.timing.navigationStart,
   domInteractive: performance.timing.domInteractive - performance.timing.navigationStart,
   domComplete: performance.timing.domComplete - performance.timing.navigationStart,
   loadEventEnd: performance.timing.loadEventEnd - performance.timing.navigationStart });
```

This was repeated five times, and I picked three results based on similar
responseStart values. This provides a fairer comparison by avoiding bias of
fluctuation from the network/server. The actual values ended up slightly
favouring the older code.

| -------------- | ---------------- | ---------------- | -------- |
|                | Before           | After            | Avg diff |
| -------------- | ---------------- | ---------------- | -------- |
| responseStart  | 1044, 1001, 1016 | 1025, 1023, 1024 | +3ms     |
| domInteractive | 2080, 2069, 2059 | 1872, 2101, 2050 | -61ms    |
| domComplete    | 4361, 4239, 3927 | 3691, 4023, 3981 | -227ms   |
| loadEventEnd   | 4366, 4244, 3932 | 3691, 4023, 3982 | -282ms   |
| mwLoadEnd      | 4524, 4416, 4113 | 3994, 4320, 4297 | -147ms   |
| -------------- | ---------------- | ---------------- | -------- |

== Implementation

While technically a single logical change, this commit does
resolve multiple long-standing issues and inefficiencies.

* handlePending (now called doPropagation) was called way more
  often than needed. When a load.php response arrived with calls
  to mw.loader.implement(), each one could execute and immediately
  call handlePending().
  Now, the first implementation in a batch schedule one call
  doPropagation(), and the later ones ride along that one call.

* Most calls to handlePending were only able to execute one
  pending module, which in turn created its own handlePending
  call that started all over again. This meant that by the time
  control returned to an outer call, there was nothing left to
  do, except it still needed to continue its iteration over the
  whole registry before knowing there was nothing left to dos.

* Due to recursive calls to handlePending() from execute(), and
  due to immediate execution from implement() - as called from
  load.php or asyncEval - the stack was often already 100s of
  level deep before *starting* the execution of a module.
  Such deep stacks caused:
  - a larger memory footprint (for the stacks themselves).
  - confusing flame graphs. It was impossible to analyze
    performance of module initialisation, I typically could only
    look at code from dom-ready handlers or other events.
    The stacks were so big, they actually caused rendering
    bugs inside Chrome where higher parts of the stack would be
    trimmed, and thus related code would no longer be visually
    grouped by the same parent.
  - confusing error messages (long stack traces).

* The eager execution from mw.loader.implement() calls meant
  that it was not possible to separate the parsing/loading of
  code (by load.php and asyncEval), from the execution of code.
  Now, this is separated by a 1ms yield (in practice it's
  larger than 1ms, but it has high priority). This means that the
  batch of localStorage eval() and the batch response from
  load.php can now first do one type of work (allocating of functions
  and objects, stashing them in the registry), and then later the
  other type of work (execution of the module code) - with some
  breathing room allowed for rendering.

Bug: T127328
Bug: T202703
Change-Id: I499ae3f095545abcc03e8989f54422b1997738d3

3 years agoresources: Register easy-deflate as foreign resource
Timo Tijhof [Tue, 11 Sep 2018 02:41:19 +0000 (03:41 +0100)]
resources: Register easy-deflate as foreign resource

Change-Id: Ifc8f5a4b9346da30b0bf3b3dc25c04ce3e2778d5

3 years agoReplace 'help' with better fitting 'helpNotice' icon on tags panel
Volker E [Wed, 12 Sep 2018 21:08:50 +0000 (14:08 -0700)]
Replace 'help' with better fitting 'helpNotice' icon on tags panel

Bug: T204165
Change-Id: I90a9619c976ff37c8b7d4a9bb03a3573e00bd19d

3 years agoGive search results a consistent css class to select
Erik Bernhardson [Thu, 13 Sep 2018 18:49:59 +0000 (11:49 -0700)]
Give search results a consistent css class to select

Results with and without thumbnails only share an li, and that li
cannot be specifically targeted. Add a class to the li so anything
that wants to deal with individual results can target them.

Bug: T189242
Change-Id: I9b19c5e3d7d72d4be3a5ffdf280bf07b870ff3c0

3 years agoSet break-word on figcaption
Arlo Breault [Tue, 1 May 2018 18:40:25 +0000 (14:40 -0400)]
Set break-word on figcaption

This is using the non-standard value of word-break, instead of
overflow-wrap/word-wrap, since the latter doesn't produce the desired
effect.  That may be due to figure being displayed as a table, without
the layout being "fixed".

Unfortunately, non-Webkit based browsers don't implement this and
break-all is a little heavy handed for the few cases this turns up in
practice.

Bug: T171761
Change-Id: If123d30addb4c707ebed63bafd18dccba9afe158

3 years agoMerge "build: Update eslint-config-wikimedia"
jenkins-bot [Thu, 13 Sep 2018 12:27:49 +0000 (12:27 +0000)]
Merge "build: Update eslint-config-wikimedia"

3 years agoMerge "HTMLForm: Drop this never-used backwards-compatibility"
jenkins-bot [Thu, 13 Sep 2018 12:27:43 +0000 (12:27 +0000)]
Merge "HTMLForm: Drop this never-used backwards-compatibility"

3 years agoMerge "Remove unused MediaWikiTestCase::prepareConnectionForTesting"
jenkins-bot [Thu, 13 Sep 2018 09:40:18 +0000 (09:40 +0000)]
Merge "Remove unused MediaWikiTestCase::prepareConnectionForTesting"

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 13 Sep 2018 07:36:06 +0000 (09:36 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ie5096f881b1aab8b24a3bafde2adabd1e7405e36

3 years agoMerge "Introduce constants for fetchLanguageName(s)"
jenkins-bot [Thu, 13 Sep 2018 06:24:09 +0000 (06:24 +0000)]
Merge "Introduce constants for fetchLanguageName(s)"