lhc/web/wiklou.git
3 years agoAdd release notes for 0eb4eaefd3 and f7f71359
Kunal Mehta [Tue, 12 Jun 2018 01:11:08 +0000 (18:11 -0700)]
Add release notes for 0eb4eaefd3 and f7f71359

Change-Id: Ie139db2f178660aa42009661716290158d60c8fc

3 years agoMerge "parser: Validate $length in padleft/padright parser functions"
jenkins-bot [Tue, 12 Jun 2018 00:39:53 +0000 (00:39 +0000)]
Merge "parser: Validate $length in padleft/padright parser functions"

3 years agoMake $wgEmailConfirmToEdit only affect edit actions.
Brian Wolff [Fri, 26 Aug 2016 01:29:58 +0000 (01:29 +0000)]
Make $wgEmailConfirmToEdit only affect edit actions.

Previously it would affect all actions that use Title::userCan.
This used to be less noticable, but recently was expanded to include
the 'read' action. This only affected the case where both
$wgBlockDisablesLogin and $wgEmailConfirmedToEdit were enabled.

I don't think anyone was relying on the old behaviour as it was
undocumented, and only affected obscure permissions (checked with
Title::userCan and not depending on "edit" rights)

Follow-up b675be2083

Bug: T143790
Change-Id: I4ad93ed78de4f1ed444f73df6dc26d405a67e553

3 years agoMerge "Remove deprecated hook EditPageBeforeEditChecks"
jenkins-bot [Mon, 11 Jun 2018 23:53:58 +0000 (23:53 +0000)]
Merge "Remove deprecated hook EditPageBeforeEditChecks"

3 years agoMerge "PHP: Use short ternary operator (?:) where possible"
jenkins-bot [Mon, 11 Jun 2018 23:06:59 +0000 (23:06 +0000)]
Merge "PHP: Use short ternary operator (?:) where possible"

3 years agoRemove deprecated hook EditPageBeforeEditChecks
Bartosz Dziewoński [Wed, 30 Aug 2017 19:07:49 +0000 (21:07 +0200)]
Remove deprecated hook EditPageBeforeEditChecks

Change-Id: I525a3a81787214dae42d3ce641d8c62761d17797

3 years agoregistration: Catch correct exception type from ObjectCache
Kunal Mehta [Mon, 11 Jun 2018 20:57:58 +0000 (13:57 -0700)]
registration: Catch correct exception type from ObjectCache

ObjectCache::newFromId() now throws an InvalidArgumentException if the
specific id can't be found.

Change-Id: Idcb0f2158a38555c1ec1681ba0635c7903e48718

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 11 Jun 2018 20:14:10 +0000 (22:14 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I266e6f3e0974d9e597e86b5790871cd118043d57

3 years agoMerge "Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient"
jenkins-bot [Mon, 11 Jun 2018 19:29:55 +0000 (19:29 +0000)]
Merge "Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient"

3 years agoMerge "npm selenium command, use bash"
jenkins-bot [Mon, 11 Jun 2018 18:03:59 +0000 (18:03 +0000)]
Merge "npm selenium command, use bash"

3 years agoUse PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Fomafix [Mon, 11 Jun 2018 17:23:15 +0000 (19:23 +0200)]
Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient

This is a followup to 485f66f1.

Change-Id: I7a2a44b7e933103178929b3cdc015859612c8b35

3 years agoAdd langauge 'zgh' Standard Moroccan Amazigh
Étienne Beaulé [Wed, 23 May 2018 02:33:16 +0000 (23:33 -0300)]
Add langauge 'zgh' Standard Moroccan Amazigh

This change adds the Standard Moroccan Amazigh language with ISO
639-3 code 'zgh' with 'kab' (Kabyle) fallback. The default script is the
Neo-Tifinagh script.

Bug: T137491
Change-Id: Idd13f92d7ae05cd47267558c8ff4fa368b701e24

3 years agoPHP: Use short ternary operator (?:) where possible
Fomafix [Mon, 11 Jun 2018 09:16:48 +0000 (11:16 +0200)]
PHP: Use short ternary operator (?:) where possible

Change-Id: Idcc7e4fcdd4d8302ceda44bf6d294fa8c2219381

3 years agonpm selenium command, use bash
addshore [Thu, 7 Jun 2018 16:15:30 +0000 (17:15 +0100)]
npm selenium command, use bash

On Windows this seems to complain unless bash is specified

Change-Id: I4515c851ffea143d4c1c6d111ffdd64b62f9f304

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 10 Jun 2018 20:02:06 +0000 (22:02 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ie01e48ef17e431ae619237e8ae1e2810d454d1de

3 years agoparser: Validate $length in padleft/padright parser functions
Kunal Mehta [Sun, 10 Jun 2018 18:09:07 +0000 (11:09 -0700)]
parser: Validate $length in padleft/padright parser functions

$length is user input, so cast it to an int before passing it to min().
If there is nothing to add at that point, return immediately.

In PHP 7.1+ this raised a warning of "A non-numeric value encountered"
because min() will return the junk value, returning a string. Then we
try and subtract an int from it (return value of mb_strlen()),
triggering the warning.

Added a parser test to verify the behavior, and confirmed that it
triggers warnings without the patch.

Bug: T180403
Change-Id: I614750962104f6251a864519035366ac9798fc0f

3 years agoSECURITY: Special:BotPasswords should reauthenticate
Brad Jorsch [Wed, 9 May 2018 19:14:38 +0000 (15:14 -0400)]
SECURITY: Special:BotPasswords should reauthenticate

More specifically, it should reauthenticate when creating a bot password
or resetting the password. But we may as well do it for all accesses.

Bug: T193237
Change-Id: I9a38a3109492753fff1f33c0f280e5b0f1fc1a76

3 years agoMerge "WebInstaller::docLink: Use Html::element to generate the link"
jenkins-bot [Sun, 10 Jun 2018 08:17:23 +0000 (08:17 +0000)]
Merge "WebInstaller::docLink: Use Html::element to generate the link"

3 years agoMerge "WebInstaller::getDocUrl: Use getUrl to generate the URL"
jenkins-bot [Sun, 10 Jun 2018 08:16:52 +0000 (08:16 +0000)]
Merge "WebInstaller::getDocUrl: Use getUrl to generate the URL"

3 years agoMerge "Localize some special pages into Korean (ko)"
jenkins-bot [Sun, 10 Jun 2018 08:02:59 +0000 (08:02 +0000)]
Merge "Localize some special pages into Korean (ko)"

3 years agoMerge "resourceloader: Re-enable testGetBlobCached() test case"
jenkins-bot [Sun, 10 Jun 2018 07:58:42 +0000 (07:58 +0000)]
Merge "resourceloader: Re-enable testGetBlobCached() test case"

3 years agoMerge "FormatJson: cleanup after PHP 5.5 support removal"
jenkins-bot [Sun, 10 Jun 2018 07:58:40 +0000 (07:58 +0000)]
Merge "FormatJson: cleanup after PHP 5.5 support removal"

3 years agoLocalize some special pages into Korean (ko)
Yongmin Hong [Sat, 2 Jun 2018 13:05:37 +0000 (22:05 +0900)]
Localize some special pages into Korean (ko)

* (Manually) synced from MessagesEn.php
* Changed Listfiles so it is less ambigious.

Change-Id: I59da5461efcc34511f99872cfc26d2ae63a52531
Signed-off-by: Yongmin Hong <revi@pobox.com>
3 years agoMerge "Escape text in Linker::specialLink()"
jenkins-bot [Sun, 10 Jun 2018 07:49:49 +0000 (07:49 +0000)]
Merge "Escape text in Linker::specialLink()"

3 years agoMerge "Get rid of call_user_func(_array)(), part 3"
jenkins-bot [Sun, 10 Jun 2018 02:46:30 +0000 (02:46 +0000)]
Merge "Get rid of call_user_func(_array)(), part 3"

3 years agoGet rid of call_user_func(_array)(), part 3
Max Semenik [Sat, 9 Jun 2018 23:26:32 +0000 (16:26 -0700)]
Get rid of call_user_func(_array)(), part 3

Also cleaned up nearby code in a couple places.

Change-Id: Ibf44ee7c0ceb739d7e79406e4ff39303c316e285

3 years agoClean up CSPRNG support for PHP7
Max Semenik [Fri, 19 Jan 2018 22:42:56 +0000 (14:42 -0800)]
Clean up CSPRNG support for PHP7

Replace it all with random_bytes(), leave
only MWCryptRand::generateHex() as a convenience helper.

Change-Id: Ic30376a90e66d8f00dab86e7e6466fb3a750b87d

3 years agoMerge "Remove PhanParamReqAfterOpt from blacklist"
jenkins-bot [Sat, 9 Jun 2018 19:43:46 +0000 (19:43 +0000)]
Merge "Remove PhanParamReqAfterOpt from blacklist"

3 years agoMerge "LoginSignupSpecialPage: Use $this->msg instead of wfMessage"
jenkins-bot [Sat, 9 Jun 2018 14:30:39 +0000 (14:30 +0000)]
Merge "LoginSignupSpecialPage: Use $this->msg instead of wfMessage"

3 years agoMerge "Replace call_user_func_array(), part 2"
jenkins-bot [Sat, 9 Jun 2018 14:25:26 +0000 (14:25 +0000)]
Merge "Replace call_user_func_array(), part 2"

3 years agoLoginSignupSpecialPage: Use $this->msg instead of wfMessage
Fomafix [Sat, 9 Jun 2018 12:57:26 +0000 (14:57 +0200)]
LoginSignupSpecialPage: Use $this->msg instead of wfMessage

Change-Id: If1313112f39a449857028da6a4a22d6950c500a3

3 years agoFormatJson: cleanup after PHP 5.5 support removal
Kevin Israel [Sat, 9 Jun 2018 13:06:02 +0000 (09:06 -0400)]
FormatJson: cleanup after PHP 5.5 support removal

* Use PHP 5.6 constant expression support in definition of ALL_OK.
* Remove one level of nesting in encode(). Follows up I801eaffc.
* Update HTML5 section number in doc comment for XMLMETA_OK.
* Made other minor doc comment fixes, such as capitalizing "JSON".
* Not done: changing $badChars and $badCharsEscaped to constants.
  This will have to wait until HHVM 3.18 support is dropped.

Change-Id: I06413dfe0fedddfd20d3e375eadd9daad6d6230e

3 years agoMerge "Hard deprecate Interwiki static methods"
jenkins-bot [Sat, 9 Jun 2018 09:33:09 +0000 (09:33 +0000)]
Merge "Hard deprecate Interwiki static methods"

3 years agoRemove PhanParamReqAfterOpt from blacklist
Erik Bernhardson [Fri, 8 Jun 2018 21:46:41 +0000 (14:46 -0700)]
Remove PhanParamReqAfterOpt from blacklist

Change-Id: I569656068c9034f7325312afcce837e2712b4f29

3 years agoMerge "Resolve required parameter after optional in language"
jenkins-bot [Sat, 9 Jun 2018 09:20:54 +0000 (09:20 +0000)]
Merge "Resolve required parameter after optional in language"

3 years agoMerge "Resolve required parameter after optional in specials"
jenkins-bot [Sat, 9 Jun 2018 09:14:24 +0000 (09:14 +0000)]
Merge "Resolve required parameter after optional in specials"

3 years agoMerge "Resolve required parameter after optional in Xml"
jenkins-bot [Sat, 9 Jun 2018 09:08:46 +0000 (09:08 +0000)]
Merge "Resolve required parameter after optional in Xml"

3 years agoMerge "Resolve required parameter after optional in Message"
jenkins-bot [Sat, 9 Jun 2018 08:53:09 +0000 (08:53 +0000)]
Merge "Resolve required parameter after optional in Message"

3 years agoMerge "Resolve required parameter after optional parameter in Linker"
jenkins-bot [Sat, 9 Jun 2018 08:49:54 +0000 (08:49 +0000)]
Merge "Resolve required parameter after optional parameter in Linker"

3 years agoEscape text in Linker::specialLink()
Matěj Suchánek [Thu, 16 Mar 2017 20:24:55 +0000 (20:24 +0000)]
Escape text in Linker::specialLink()

Linker::linkKnown -> Linker::link -> $text is wrapped by HtmlArmor

Bug: T85864
Change-Id: I8755948131ffca4a0b5949b2f8cabf19f59c1c9e

3 years agoMerge "Rewrite IEUrlExtensionTest using a data provider"
jenkins-bot [Sat, 9 Jun 2018 08:42:02 +0000 (08:42 +0000)]
Merge "Rewrite IEUrlExtensionTest using a data provider"

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 9 Jun 2018 07:58:40 +0000 (09:58 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I5bd33ca666aaa4ad76bbae4e0cc9d3e7cb44c345

3 years agoRewrite IEUrlExtensionTest using a data provider
Kunal Mehta [Sat, 9 Jun 2018 06:07:38 +0000 (23:07 -0700)]
Rewrite IEUrlExtensionTest using a data provider

Change-Id: I67568f997d682b88ad99676a57b85395b1b20f85

3 years agoResolve required parameter after optional in specials
Erik Bernhardson [Fri, 8 Jun 2018 21:42:27 +0000 (14:42 -0700)]
Resolve required parameter after optional in specials

Change-Id: If2c85d97d68b24fc5cb2bec19804034b994b348d

3 years agoAdd more logging to ChronologyProtector::initPositions()
Aaron Schulz [Fri, 8 Jun 2018 22:14:05 +0000 (15:14 -0700)]
Add more logging to ChronologyProtector::initPositions()

Bug: T194403
Change-Id: I8f1ccb3c6e257ae48ae6bbecd8f2a8f51cd2ed41

3 years agoResolve required parameter after optional parameter in Linker
Erik Bernhardson [Fri, 8 Jun 2018 21:32:55 +0000 (14:32 -0700)]
Resolve required parameter after optional parameter in Linker

Change-Id: I2569e30922e93404a59fa282df8ae8d3d19912fd

3 years agoResolve required parameter after optional in Message
Erik Bernhardson [Fri, 8 Jun 2018 21:33:02 +0000 (14:33 -0700)]
Resolve required parameter after optional in Message

It looks like this parameter has had a default since it was first
created, and somehow kept it even after a new parameter was added
to the end. codesearch.wmflabs.org suggests, and I could not find,
and calls to this function from any other code that would need
the defaulted param (probably because they fail due to the later
required parameter).

Change-Id: Iae6e736c5c957d9fccb6ab5813a3b5b02eeb3f6f

3 years agoResolve required parameter after optional in Xml
Erik Bernhardson [Fri, 8 Jun 2018 21:37:17 +0000 (14:37 -0700)]
Resolve required parameter after optional in Xml

Change-Id: If04d3b347ec2839b986d8fe85d3f2ed392fc83ed

3 years agoResolve required parameter after optional in language
Erik Bernhardson [Fri, 8 Jun 2018 21:46:03 +0000 (14:46 -0700)]
Resolve required parameter after optional in language

Change-Id: I6e0c3b14f1bcea112be7ab694efff5a67622d637

3 years agoMerge "build: Allow HHVM 3.21+ failures in Travis"
jenkins-bot [Fri, 8 Jun 2018 20:52:06 +0000 (20:52 +0000)]
Merge "build: Allow HHVM 3.21+ failures in Travis"

3 years agoMerge "(y)etsin fixes, test refactoring, and misc fixes"
jenkins-bot [Fri, 8 Jun 2018 20:46:12 +0000 (20:46 +0000)]
Merge "(y)etsin fixes, test refactoring, and misc fixes"

3 years agoFollow-up Ieaeb3113a: Add RELEASE-NOTES
Jforrester [Fri, 8 Jun 2018 19:55:45 +0000 (19:55 +0000)]
Follow-up Ieaeb3113a: Add RELEASE-NOTES

Change-Id: I79f1d28b54532a7495fb8e205c9b6636016587d7

3 years agoMerge "CurlHttpRequest: remove open_basedir check"
jenkins-bot [Fri, 8 Jun 2018 19:01:30 +0000 (19:01 +0000)]
Merge "CurlHttpRequest: remove open_basedir check"

3 years agoFix phpdoc for wfMessage $params for phan
Kunal Mehta [Fri, 8 Jun 2018 17:43:39 +0000 (10:43 -0700)]
Fix phpdoc for wfMessage $params for phan

phan and phpDoc expect that the type of variadic params is the type of
each individual item.

Change-Id: I8229d52b3e4b70a9de6c5bb813bab776c5547e5d

3 years agoCurlHttpRequest: remove open_basedir check
Kevin Israel [Fri, 8 Jun 2018 17:46:10 +0000 (13:46 -0400)]
CurlHttpRequest: remove open_basedir check

This only applied to PHP 5.5 and older, which we no longer support,
and was apparently overlooked in I740f32ac.

Change-Id: I1d56ac0ef7ac2cc14da16e1397e9614564c7ee23

3 years agoRelease notes for I57e05c5ae
Kunal Mehta [Thu, 7 Jun 2018 19:52:04 +0000 (12:52 -0700)]
Release notes for  I57e05c5ae

Cherry picked from commit d5e4bf920c7.

Change-Id: Ie7c9393c5a77279b9342152b9fdc187f22acf5c0

3 years agoMerge "Ensure $user is passed by reference in TitleMoveComplete hook on HHVM"
jenkins-bot [Fri, 8 Jun 2018 14:27:44 +0000 (14:27 +0000)]
Merge "Ensure $user is passed by reference in TitleMoveComplete hook on HHVM"

3 years agobuild: Allow HHVM 3.21+ failures in Travis
Timo Tijhof [Fri, 8 Jun 2018 14:22:43 +0000 (16:22 +0200)]
build: Allow HHVM 3.21+ failures in Travis

Keep them in the post-merge matrix, but don't make its failure
affect the commit status indicator (e.g. "non-voting").

Wikimedia only runs HHVM 3.18 in production at the moment, and
it seems these newer versions don't currently pass the test and
fixing them is probably not a priority at the moment.

Follows-up 8fde6115a8368e.

Change-Id: I8f6e637882e89663257cafd8c832f71131a9c488

3 years agoMerge "HashRing: use bisection instead of guess and refine"
jenkins-bot [Fri, 8 Jun 2018 10:11:22 +0000 (10:11 +0000)]
Merge "HashRing: use bisection instead of guess and refine"

3 years agoMerge "Enable InterwikiTest::testDatabaseStorage()"
jenkins-bot [Fri, 8 Jun 2018 09:39:02 +0000 (09:39 +0000)]
Merge "Enable InterwikiTest::testDatabaseStorage()"

3 years agoHashRing: use bisection instead of guess and refine
Tim Starling [Thu, 7 Jun 2018 05:26:47 +0000 (15:26 +1000)]
HashRing: use bisection instead of guess and refine

Use bisection to find the position within the ring, as in ketama.
According to my benchmarking this is faster than the guess/refine
algorithm for rings with 100 locations, i.e. 16000 ring nodes requiring
at most 14 bisection iterations.

Change-Id: I6042f382de093081971b5ec210eda8dfa74988f2

3 years agoFix wfMessage() annotation
Max Semenik [Fri, 8 Jun 2018 06:06:02 +0000 (23:06 -0700)]
Fix wfMessage() annotation

$params is a variadic parameter now, so it must be treated as an
array. Same thing for wfMessageFallback().

Change-Id: I606deb7ea0fb9be25ac79aadfbab0cc44bdc36a0

3 years agoMerge "Rewrite HashRing to use consistent hashing"
jenkins-bot [Fri, 8 Jun 2018 05:25:25 +0000 (05:25 +0000)]
Merge "Rewrite HashRing to use consistent hashing"

3 years agoReplace call_user_func_array(), part 2
Max Semenik [Fri, 8 Jun 2018 02:58:35 +0000 (19:58 -0700)]
Replace call_user_func_array(), part 2

Uses new PHP 5.6 syntax like ...parameter unpacking and
calling anything looking like a callback to make the code more readable.
There are much more occurrences but this commit is intentionally limited
to an easily reviewable size.

In one occurrence, a simple conditional instead of trickery was much more readable.

This patch finishes all the easy stuf in the core, the remainder is either unobvious
or would result in smaller readability gains. It will be carefully dealt with in
further commits.

Change-Id: I79a16c48bfb98b75e5b99f2f6f4fa07b3ae02c5b

3 years agomediawiki.skinning: Remove styles for `#jump-to-nav` from core
Timo Tijhof [Thu, 7 Jun 2018 13:14:47 +0000 (15:14 +0200)]
mediawiki.skinning: Remove styles for `#jump-to-nav` from core

There are no longer any skins bundled with MediaWiki releases that
use it. Styling for this should be the skins' responsibility.

Vector and MonoBook no longer use this element, and core's
providing of these styles actually creates conflicts.

For skins using 'mediawiki.legacy.oldshared' (predating MonoBook),
no changes are required! Their jump-to-nav styles remain preserved.

For skins that use 'mediawiki.skinning.interface' and have
MonoBook-inspired accessibility links within a `<div id="#jump-to-nav">`,
need to make one of two changes:

1. Adopt the new CSS-only approach documented in T195256,
   as used by current MonoBook and Vector.

2. Or; Add a copy of the old CSS (included below) to your own skins'
   stylesheet and ensure the `jquery.mw-jump` module is loaded (previously
   by default), either by adding `$out->addModules( 'jquery.mw-jump' )`, or
   by adding it from the skin's Skin::getDefaultModules() override.

    @media screen {
        #jump-to-nav {
            /* Negate #contentSub margin */
            margin-top: -1.4em;
            margin-bottom: 1.4em;
            -moz-user-select: none;
            -webkit-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }
        .mw-jump, #jump-to-nav {
            overflow: hidden;
            height: 0;
            zoom: 1;
        }
    }

    @media print {
        .mw-jump, #jump-to-nav {
            display: none;
        }
    }

This migration guide will be added to the T195256 task description,
to which the release notes refer.

Bug: T195256
Change-Id: I84bcd23180b3d1fa541728989f44a376189df95d

3 years agoUpdate OOUI to v0.27.3
James D. Forrester [Thu, 7 Jun 2018 21:40:12 +0000 (14:40 -0700)]
Update OOUI to v0.27.3

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

Depends-On: Ifc0bfbbffb66dd45ebf442a227ae734de9b41964
Change-Id: Ifc0bfbbffb66dd45ebf442a227ae734de9b41961

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 7 Jun 2018 21:19:17 +0000 (23:19 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I76a6f7a48e28f135120f73121eac582dd96b3411

3 years agoEnsure $user is passed by reference in TitleMoveComplete hook on HHVM
Kunal Mehta [Thu, 7 Jun 2018 19:52:04 +0000 (12:52 -0700)]
Ensure $user is passed by reference in TitleMoveComplete hook on HHVM

Suggested by Anomie in T118683#3688320.

Bug: T118683
Change-Id: I57e05c5ae42c8b85d0a8f9631a459c5686b27893

3 years agoEnable InterwikiTest::testDatabaseStorage()
Kunal Mehta [Thu, 7 Jun 2018 18:44:30 +0000 (11:44 -0700)]
Enable InterwikiTest::testDatabaseStorage()

The patch mentioned in the skip message was never merged, but the test
passes now.

Change-Id: Ifa28fbf1d8967fc3dac0f81032ef3f2439efb86c

3 years agoHard deprecate Interwiki static methods
Kunal Mehta [Thu, 7 Jun 2018 18:40:46 +0000 (11:40 -0700)]
Hard deprecate Interwiki static methods

Change-Id: I803df3ef90bf6b602e85ae48f25745f4dc6aab3a

3 years agoMerge "registration: Allow the mtime of extension.json files to be zero"
jenkins-bot [Thu, 7 Jun 2018 18:10:54 +0000 (18:10 +0000)]
Merge "registration: Allow the mtime of extension.json files to be zero"

3 years agoregistration: Allow the mtime of extension.json files to be zero
Ed Schouten [Thu, 7 Jun 2018 12:21:53 +0000 (14:21 +0200)]
registration: Allow the mtime of extension.json files to be zero

When creating Docker images of MediaWiki using the Bazel build system, I
noticed that I'm not able to load any extensions. This is due to the
fact that Bazel always generates container layers with mtimes of files
set to 1970-01-01 for determinism/reproducibility.

Relax the check a bit to only fail when the mtime is false, which
happens when filemtime() fails.

Bug: T196672
Change-Id: Ieaeb3113a7d9c44f29cca2d062c5bb11ebeada0d

3 years agoRestore original OpenSearch namespaces
Lucas Werkmeister [Thu, 7 Jun 2018 16:48:39 +0000 (18:48 +0200)]
Restore original OpenSearch namespaces

Though that URL may no longer resolve, the correct XML namespace for
OpenSearch remains http://a9.com/-/spec/opensearch/1.1/ – see [1] and
[2] for some discussion clarifying this.

Similarly, the canonical namespace URL for MozSearch uses HTTP, not
HTTPS, as can be seen when visiting it (via either protocol) [3].

This reverts commit 3b86cf03c162298211da2f57333bcc645123a979.

[1]: https://github.com/dewitt/opensearch/issues/3
[2]: https://groups.google.com/d/msg/opensearch/8ecuX35-lEs/JR_cs0N6k68J
[3]: https://www.mozilla.org/2006/browser/search/

Bug: T196643
Change-Id: I8d14660550a5c67cefc421a334502963bfd6ed3c

3 years agoMerge "installer: Fix display of UPGRADE by disabling InterwikiLookup"
jenkins-bot [Thu, 7 Jun 2018 16:49:40 +0000 (16:49 +0000)]
Merge "installer: Fix display of UPGRADE by disabling InterwikiLookup"

3 years agoMerge "Add code to write to change_tag_def table"
jenkins-bot [Thu, 7 Jun 2018 16:26:23 +0000 (16:26 +0000)]
Merge "Add code to write to change_tag_def table"

3 years agoMerge "Add getLoginSecurityLevel() support to FormSpecialPage"
jenkins-bot [Thu, 7 Jun 2018 14:50:14 +0000 (14:50 +0000)]
Merge "Add getLoginSecurityLevel() support to FormSpecialPage"

3 years agoMerge "tests: Reset mwuser/pagecontent tables if necessary for postgres"
jenkins-bot [Thu, 7 Jun 2018 14:39:15 +0000 (14:39 +0000)]
Merge "tests: Reset mwuser/pagecontent tables if necessary for postgres"

3 years agoMerge "Introduce per-schema unit tests for revision storage."
jenkins-bot [Thu, 7 Jun 2018 13:47:00 +0000 (13:47 +0000)]
Merge "Introduce per-schema unit tests for revision storage."

3 years agoMerge "Reset relevant DB tables before the first test of a suite."
jenkins-bot [Thu, 7 Jun 2018 13:46:56 +0000 (13:46 +0000)]
Merge "Reset relevant DB tables before the first test of a suite."

3 years agoIntroduce per-schema unit tests for revision storage.
daniel [Mon, 14 May 2018 11:57:43 +0000 (13:57 +0200)]
Introduce per-schema unit tests for revision storage.

This introduces traits for testing different schema variations.
These are not very useful in this patch, but make it much easier
to add tests for MCR schema migration in subsequent patches.

The code in this patch was previously part of If259b1e1c49ceaa4.

Change-Id: I239572f75bebbc9c731a3e3860c4eff179dc15e4

3 years agoReset relevant DB tables before the first test of a suite.
daniel [Thu, 7 Jun 2018 12:36:06 +0000 (14:36 +0200)]
Reset relevant DB tables before the first test of a suite.

MediaWikiTestCase truncates all the tables in the tablesUsed field
after each test. It should also do that before the first test of the
class.

Change-Id: I8c33be7b1bdd83559a9ea7803471a1f39e0eb870

3 years agoMerge "Replace call_user_func_array(), part 1"
jenkins-bot [Thu, 7 Jun 2018 12:11:10 +0000 (12:11 +0000)]
Merge "Replace call_user_func_array(), part 1"

3 years agoRewrite HashRing to use consistent hashing
Aaron Schulz [Thu, 8 Mar 2018 03:03:32 +0000 (19:03 -0800)]
Rewrite HashRing to use consistent hashing

This scheme avoids disruptive re-hashing when a node is
ejected; only the adjectent clockwise sector is affected,
the later taking responsibility for the former. Addition
of new nodes is likewise less disruptive.

When used with MD5, this maps keys the same as libketama.

Also:
* Make HashRing::getLocations() faster by guessing the
  sector list index and moving clockwise/counter-clockwise.
* Made HashRing Serializable for more robust storage.
* Allow for different hash functions to be specified.

Note:
* This makes PoolCounterRedis use the new hash scheme.
* Likewise for JobQueueFederated (for job de-duplication).
  Switching from one mode to the other will cause some of
  duplicated effort from old jobs only temporarily.

Change-Id: Iff432a4e5dc3fb40b2dda70fb3dbe9dda0b74933

3 years agoresourceloader: move Message methods from mediawiki.js to base module
Aaron Schulz [Wed, 6 Jun 2018 00:13:10 +0000 (17:13 -0700)]
resourceloader: move Message methods from mediawiki.js to base module

Also set "use strict" in the base module.

Bug: T192623
Change-Id: I18a710e167df8be47a70da93a7aba0784fc62aef

3 years agoWebInstaller::docLink: Use Html::element to generate the link
Fomafix [Thu, 7 Jun 2018 09:34:00 +0000 (11:34 +0200)]
WebInstaller::docLink: Use Html::element to generate the link

Change-Id: I1e3163d9814345e6b108072886b9756cc84d168a

3 years agoWebInstaller::getDocUrl: Use getUrl to generate the URL
Fomafix [Thu, 7 Jun 2018 08:07:15 +0000 (10:07 +0200)]
WebInstaller::getDocUrl: Use getUrl to generate the URL

This changes ensures to generate the same URLs on doclinks like in the
navigation bar.

mw-config/?page=Welcome has as "Restart installation" the URL
  /.../mw-config/?page=Restart&lastPage=Language
and as "a copy of the GNU General Public License" the URL
before this change
  /.../mw-config/index.php?page=Copying&lastPage=Welcome
after this change
  /.../mw-config/?page=Copying&lastPage=Welcome

Change-Id: Ide5cb52d71363c3a54e1b6ac48c272e1de823322

3 years agoMerge "Fix UploadBase::checkXMLEncodingMissmatch() on PHP 7.1+"
jenkins-bot [Thu, 7 Jun 2018 08:57:27 +0000 (08:57 +0000)]
Merge "Fix UploadBase::checkXMLEncodingMissmatch() on PHP 7.1+"

3 years agoinstaller: Fix display of UPGRADE by disabling InterwikiLookup
Kunal Mehta [Thu, 7 Jun 2018 08:01:13 +0000 (01:01 -0700)]
installer: Fix display of UPGRADE by disabling InterwikiLookup

Since 129067c907ea65f62, parsing section titles has looked up interwiki
prefixes with InterwikiLookup. In the web upgrader, this triggers
database access, and since that service is disabled, it throws
exceptions, causing parsing to fail.

Work around that by using a dummy InterwikiLookup service that knows
about no interwiki prefixes. Maybe one could be written to just read
from the stock `interwiki.list`, but that's a project for another time.

Bug: T196607
Change-Id: I13485a9af79297b552a1128240cb8597c2ef83d8

3 years agoMerge "Revert "docs: Rename README to README.md""
jenkins-bot [Thu, 7 Jun 2018 07:06:59 +0000 (07:06 +0000)]
Merge "Revert "docs: Rename README to README.md""

3 years agoRevert "docs: Rename README to README.md"
Legoktm [Thu, 7 Jun 2018 06:53:59 +0000 (06:53 +0000)]
Revert "docs: Rename README to README.md"

This file is parsed in the web installer, which doesn't
understand markdown - it uses the MediaWiki parser.

This reverts commit c0342da8e9a675ce6803d651a781addb801ef8f3.

Bug: T196607
Change-Id: If35f0212dafa80afe59c019ab25b875cd0977fc8

3 years agotests: Reset mwuser/pagecontent tables if necessary for postgres
Kunal Mehta [Sat, 2 Jun 2018 03:31:52 +0000 (20:31 -0700)]
tests: Reset mwuser/pagecontent tables if necessary for postgres

As of 556c5cf464b9, postgres renames the `user` and `text` tables to
`mwuser` and `pagecontent` respectively. Have resetDB() explicitly
reset those tables when using postgres.

Bug: T195807
Change-Id: I5052dd663a4fb16389611cd2985b712fb9a15069

3 years agoFix UploadBase::checkXMLEncodingMissmatch() on PHP 7.1+
Kunal Mehta [Thu, 7 Jun 2018 00:54:07 +0000 (17:54 -0700)]
Fix UploadBase::checkXMLEncodingMissmatch() on PHP 7.1+

file_get_contents() started supporting a negative offset in 7.1+. But
we really just want to start with 0.

Also fix the order of arguments to assertSame() so that the expected
value is first.

Bug: T182366
Change-Id: I84c92652de5b51a43f6e2b58cd235d2889093453

3 years agoMerge "Use the old linkshere-related messages without "-2""
jenkins-bot [Wed, 6 Jun 2018 21:15:36 +0000 (21:15 +0000)]
Merge "Use the old linkshere-related messages without "-2""

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 6 Jun 2018 20:26:48 +0000 (22:26 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I6ffcde700fa06cecb3d4bc4016ddc3c0ca2559e9

3 years agoMerge "Add RELEASE-NOTES for I4678250331a48db4d50d1fc6c489c991a4dee920"
jenkins-bot [Wed, 6 Jun 2018 18:48:21 +0000 (18:48 +0000)]
Merge "Add RELEASE-NOTES for I4678250331a48db4d50d1fc6c489c991a4dee920"

3 years agoMerge "Selenium tests: Use assert.strictEqual instead of assert.equal"
jenkins-bot [Wed, 6 Jun 2018 18:36:53 +0000 (18:36 +0000)]
Merge "Selenium tests: Use assert.strictEqual instead of assert.equal"

3 years agoAdd RELEASE-NOTES for I4678250331a48db4d50d1fc6c489c991a4dee920
Reedy [Wed, 6 Jun 2018 18:31:49 +0000 (18:31 +0000)]
Add RELEASE-NOTES for I4678250331a48db4d50d1fc6c489c991a4dee920

Change-Id: Ic880a54427bf8bd9adf96863da25c485cb3c5662

3 years agoMerge "maintenance/purgePage.php output page being purged"
jenkins-bot [Wed, 6 Jun 2018 18:21:27 +0000 (18:21 +0000)]
Merge "maintenance/purgePage.php output page being purged"

3 years agoMerge "mediawiki.js: Fix eslint valid-jsdoc"
jenkins-bot [Wed, 6 Jun 2018 18:21:24 +0000 (18:21 +0000)]
Merge "mediawiki.js: Fix eslint valid-jsdoc"

3 years agoMerge "Avoid "unittest_imagelinks" already exists error in tests"
jenkins-bot [Wed, 6 Jun 2018 18:21:21 +0000 (18:21 +0000)]
Merge "Avoid "unittest_imagelinks" already exists error in tests"