lhc/web/wiklou.git
5 years agoregistration: Let extensions add PHP version requirements
MGChecker [Sat, 8 Sep 2018 00:02:53 +0000 (02:02 +0200)]
registration: Let extensions add PHP version requirements

While MediaWiki Core already sets requirements for PHP versions, it should be
possible for extensions to tighten these requirements. This mirrors the PHP
parameter of extension infoboxes as well.

This change introduces a new 'platform' key (in addition to 'MediaWiki', 'skins'
and 'extensions', where non-MediaWiki software requirements will be listed
in the future, starting with a PHP version constraint. Further keys are
supposed to be added to allow setting constraints against php extensions
and other abilities of the platform.

Bug: T197535
Change-Id: I6744cc0be2363b603331af9dc860eb8603a1a89a

5 years agoFix some double escaping, and some incorrect escaping for convert()
Brian Wolff [Thu, 20 Sep 2018 06:28:40 +0000 (06:28 +0000)]
Fix some double escaping, and some incorrect escaping for convert()

convert() is weird and requires things to be escaped before it
is called.

This fixes a bunch of phan-taint-check warnings.

Change-Id: I422b313ca05ff61ae05e06856347cc0de832cc49

5 years agoFix some phan-taint-check false positives
Brian Wolff [Thu, 20 Sep 2018 05:38:05 +0000 (05:38 +0000)]
Fix some phan-taint-check false positives

Change-Id: Ic5ccbb3f97722476bee7188b83b80cdc652d2a64

5 years agoDeprecate QuickTemplate::msgHtml & fix phan-taint-warning in includes/skins
Brian Wolff [Thu, 20 Sep 2018 04:31:21 +0000 (04:31 +0000)]
Deprecate QuickTemplate::msgHtml & fix phan-taint-warning in includes/skins

QuickTemplate::msgHtml() (And the weird override that does the
same thing a different way - BaseTemplate::msgHtml()) are inherently
unsafe as they echo out a raw html message. This is strongly
discouraged in modern code. According to codeSearch tool, nothing
uses these methods, and there is a "@private" annotation on the
QuickTemplate::msgHtml() docblock. Thus hard deprecating it.

Change-Id: I4e9e157e922a36787adef4d0bf7608605c27f0c4

5 years agoMerge "Remove global namespaced LBFactory"
jenkins-bot [Fri, 21 Sep 2018 23:40:45 +0000 (23:40 +0000)]
Merge "Remove global namespaced LBFactory"

5 years agoMerge "Set consistent min value options for RC and Watchlist filters"
jenkins-bot [Fri, 21 Sep 2018 20:18:24 +0000 (20:18 +0000)]
Merge "Set consistent min value options for RC and Watchlist filters"

5 years agoSet consistent min value options for RC and Watchlist filters
Kosta Harlan [Fri, 21 Sep 2018 19:17:16 +0000 (15:17 -0400)]
Set consistent min value options for RC and Watchlist filters

Bug: T204623
Bug: T199049
Change-Id: If73b7cf6734f4a6a8d8e47ce8051a827ae5452e1

5 years agoMerge "CommentStore: Hard-deprecate newKey()"
jenkins-bot [Fri, 21 Sep 2018 18:42:23 +0000 (18:42 +0000)]
Merge "CommentStore: Hard-deprecate newKey()"

5 years agoRemove global namespaced LBFactory
Reedy [Fri, 21 Sep 2018 01:24:43 +0000 (02:24 +0100)]
Remove global namespaced LBFactory

Change-Id: Ia87aa5c9426af83627a1bbc9bd914546c89c1e47

5 years agoMerge "Hard deprecate non-Remex tidy modes"
jenkins-bot [Fri, 21 Sep 2018 15:37:46 +0000 (15:37 +0000)]
Merge "Hard deprecate non-Remex tidy modes"

5 years agoMcrUndoAction: Fix preview
Brad Jorsch [Fri, 21 Sep 2018 14:43:48 +0000 (10:43 -0400)]
McrUndoAction: Fix preview

Apparently DifferenceEngine::renderNewRevision() never really worked
right, it only functions when diffing *saved* revisions. Replace the
preview code with code adapted from EditPage::getPreviewText(), using
RevisionRenderer for the actual rendering.

Bug: T205101
Change-Id: I416ede84c8d10fc28866e608c9cfc3a2a7410e48

5 years agoHard deprecate non-Remex tidy modes
C. Scott Ananian [Thu, 20 Sep 2018 21:27:59 +0000 (17:27 -0400)]
Hard deprecate non-Remex tidy modes

Let's rip the band-aid off.  Remex is pure PHP so there's no reason to
be running any of the other tidy implementations any more, and we won't
be able to support them in the future.

Follow-up to 7b23382823f2ea7bab8d20ad68950ff34f50a005.

Bug: T198214
Change-Id: Id3d07d44f8434231826e86e623554cac3decfa96

5 years agoDon't show unsaved revision in DifferenceEngine::renderNewRevision.
daniel [Mon, 10 Sep 2018 19:02:26 +0000 (21:02 +0200)]
Don't show unsaved revision in DifferenceEngine::renderNewRevision.

There was a conditional that was documented to make the method bail out
if the current revision was unsaved, but it was missing the actual return
statement.

Note that preview code in EditPage does not use
DifferenceEngine::renderNewRevision.

Change-Id: I86a25e9464435ac17c72f78f7ce1f354adf3d055

5 years agoMerge "selenium: invoke jobs to enforce eventual consistency"
jenkins-bot [Fri, 21 Sep 2018 07:59:13 +0000 (07:59 +0000)]
Merge "selenium: invoke jobs to enforce eventual consistency"

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

Change-Id: I3c35fe761a9e90b551fb1435a354e337808f9f00

5 years agoMerge "tests: Stop using deprecated LBFactory, use namespaced version"
jenkins-bot [Fri, 21 Sep 2018 03:05:19 +0000 (03:05 +0000)]
Merge "tests: Stop using deprecated LBFactory, use namespaced version"

5 years agoMerge "Stop MailAddress accepting a User object"
jenkins-bot [Fri, 21 Sep 2018 02:44:00 +0000 (02:44 +0000)]
Merge "Stop MailAddress accepting a User object"

5 years agotests: Stop using deprecated LBFactory, use namespaced version
Reedy [Fri, 21 Sep 2018 01:21:24 +0000 (02:21 +0100)]
tests: Stop using deprecated LBFactory, use namespaced version

Change-Id: Ifbbbfe1bc58e57739b88588e3b6feb703f20534d

5 years agoMerge "Collapse some unnecessary else conditions"
jenkins-bot [Fri, 21 Sep 2018 02:20:23 +0000 (02:20 +0000)]
Merge "Collapse some unnecessary else conditions"

5 years agoStop MailAddress accepting a User object
Reedy [Fri, 21 Sep 2018 01:12:43 +0000 (02:12 +0100)]
Stop MailAddress accepting a User object

Bug: T204863
Change-Id: I98f110e47ec7ba3b1cd22e8d76eea4bdf7d3d155

5 years agoMerge "Drop support for array syntax for $wgSpecialPages"
jenkins-bot [Fri, 21 Sep 2018 00:37:45 +0000 (00:37 +0000)]
Merge "Drop support for array syntax for $wgSpecialPages"

5 years agoDrop support for array syntax for $wgSpecialPages
Reedy [Thu, 20 Sep 2018 22:56:48 +0000 (23:56 +0100)]
Drop support for array syntax for $wgSpecialPages

Bug: T204863
Change-Id: I03fc19cf70a7feeb7d0003de7fbc7b254a3e9560

5 years agoCollapse some unnecessary else conditions
Reedy [Thu, 20 Sep 2018 23:06:07 +0000 (00:06 +0100)]
Collapse some unnecessary else conditions

Change-Id: I9fe505f2f4ed4d10e13813d9f05127fd6571c874

5 years agoMerge "Ensure parserTests pass even if wiki has wgUsePigLatin enabled"
jenkins-bot [Thu, 20 Sep 2018 23:04:22 +0000 (23:04 +0000)]
Merge "Ensure parserTests pass even if wiki has wgUsePigLatin enabled"

5 years agoMerge "user: Allow "CAS update failed" exceptions to be normalised"
jenkins-bot [Thu, 20 Sep 2018 22:31:11 +0000 (22:31 +0000)]
Merge "user: Allow "CAS update failed" exceptions to be normalised"

5 years agoUpdate HISTORY for 1.27.5/1.29.3/1.30.1/1.31.1
Reedy [Thu, 20 Sep 2018 21:53:49 +0000 (22:53 +0100)]
Update HISTORY for 1.27.5/1.29.3/1.30.1/1.31.1

Bug: T199025
Change-Id: Iaf6b8f32d1c4c21b20483817ad0e9d3dbf3e7e22

5 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

5 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

5 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

5 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"

5 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"

5 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"

5 years agoCommentStore: Hard-deprecate newKey()
James D. Forrester [Thu, 20 Sep 2018 17:13:26 +0000 (10:13 -0700)]
CommentStore: Hard-deprecate newKey()

Not used by any extensions known to Wikimedia git.

Change-Id: I3c07ad6db9d88feddad1cf29d4794fef622298ea

5 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

5 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

5 years agoLogging related to WikiExport cleanup and changes in T203424
Bill Pirkle [Thu, 20 Sep 2018 14:54:06 +0000 (09:54 -0500)]
Logging related to WikiExport cleanup and changes in T203424

T203424 (Replace the WikiExporter backup dump streaming mode with batched queries)
removed some outdated database usage techniques.  While making these
changes, we saw some potential cleanup opportunities related
to the $history parameter to WikiExporter.  Additional logging will
inform whether we can do the additional cleanup.  If so, it can be
performed under a separate task.

Bug: T203424
Change-Id: Ic4cef23520795665c89e03f325b891346d1340a9

5 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

5 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"

5 years agoselenium: invoke jobs to enforce eventual consistency
Pablo Grass [Tue, 11 Sep 2018 14:57:48 +0000 (16:57 +0200)]
selenium: invoke jobs to enforce eventual consistency

Many tests use the API during their setup phase, which does not
participate in clearing the job queue, but constantly adds new items.
Consequently the job count keeps mounting. In order to be able to assert
the state of the application once all jobs are processed we need a way
to invoke them.
This is a minimalistic alternative to Idd4924e16925cbf0cb9e42645670c3fd76b72353

Bug: T199446
Change-Id: Ifc49bc5c06eef71da8aff1b1837c32debc2c45dd

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

5 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'"

5 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"

5 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

5 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

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

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

5 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"

5 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"

5 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"

5 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"

5 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"

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

5 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

5 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"

5 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"

5 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"

5 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"

5 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"

5 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

5 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

5 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"

5 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"

5 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

5 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

5 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

5 years agoUse binary charset in default table options
Tim Starling [Wed, 19 Sep 2018 05:38:28 +0000 (15:38 +1000)]
Use binary charset in default table options

$wgDBTableOptions is overridden in the installer-generated
LocalSettings.php, and is always set to binary now that the installer UI
option has been removed. However, the value from DefaultSettings.php is
used when the installer installs an extension, since in this case
DatabaseUpdater is called without reading the generated
LocalSettings.php.

Binary is almost certainly the right answer since many extensions can't
even be installed without this option, they hit a key length error.

Change-Id: I87df736a4d9e49c9535d55bd556e636500ca203f

5 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

5 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

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

5 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"

5 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

5 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

5 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

5 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

5 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

5 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."

5 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"

5 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

5 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

5 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"

5 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

5 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

5 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

5 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

5 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="

5 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

5 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"

5 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"

5 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"

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

5 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

5 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

5 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

5 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"

5 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

5 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"

5 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"

5 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

5 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

5 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