lhc/web/wiklou.git
5 years agoobjectcache: add BagOStuff comment additions about access scope
Aaron Schulz [Tue, 15 May 2018 22:33:38 +0000 (15:33 -0700)]
objectcache: add BagOStuff comment additions about access scope

Change-Id: Id23859a58ea3bde0338ba4d22ce12ffcbbf4480a

5 years agojquery.spinner: Remove obsolete IE8 support
Timo Tijhof [Wed, 16 May 2018 22:57:25 +0000 (00:57 +0200)]
jquery.spinner: Remove obsolete IE8 support

This is a JS-only module that cannot be loaded on IE8 given
it's currently in Grade C (Grade A requires IE11).

Change-Id: I8707d7d2fd1d20c2b354c1589248ba7fda0d5e85

5 years agojquery.spinner: Move files to their own src/ directory
Timo Tijhof [Wed, 16 May 2018 22:55:42 +0000 (00:55 +0200)]
jquery.spinner: Move files to their own src/ directory

Reduce clutter in src/jquery/.

Bug: T193826
Change-Id: Idb9c7ab89a10728249b6051057b7edbf7efcca78

5 years agomediawiki.special.watchlist: Combine visitedstatus module
Timo Tijhof [Fri, 11 May 2018 15:18:23 +0000 (16:18 +0100)]
mediawiki.special.watchlist: Combine visitedstatus module

The 'mediawiki.special.changeslist.visitedstatus' module is only
used in SpecialWatchlist.php, which also always loads
'mediawiki.special.watchlist'. Thus, registering them as seperate
deliverables isn't needed.

In terms of size, they're also sufficiently small that even if
they could load under different conditions, it'd fine to load
as one module regardless.

Bug: T192623
Change-Id: I67d78083ce7a3000c05356e3eb0bcb98d0c1e990

5 years agomediawiki.special: Combine various tiny specialpage style modules
Timo Tijhof [Fri, 11 May 2018 14:33:41 +0000 (15:33 +0100)]
mediawiki.special: Combine various tiny specialpage style modules

These stylesheets are sufficiently tiny that it doesn't make sense to
offer them the ability to be loaded separately from each other (saving
bytes in double-digits) at the cost of 1) exporting a dedicated registry
item with meta data shipped on every page view, 2) reduced cache re-use
from increased fragmentation.

Instead, move these to the 'mediawiki.special' style module.
The entries retain their own files to keep them as easy to find
and edit as before.

Where not already, ensure addModuleStyles() is always placed above
any addModules() call in the same method. The load order isn't
affected by the call order, but given blocking style-modules load
before async JS, it helps to order them in a way that visually
matches the effective load order (from top to bottom).

The following 7 modules were remove without deprecation:

1. "mediawiki.special.apisandbox.styles" (1 rule)
2. "mediawiki.special.edittags.styles" (3 rules)
3. "mediawiki.special.movePage.styles" (1 rule)
4. "mediawiki.special.pagesWithProp" (1 rule)
5. "mediawiki.special.upload.styles" (2 rules)
6. "mediawiki.special.watchlist.styles" (3 rules)
7. "mediawiki.special.comparepages.styles" (4 rules)

These module names were only used on the core classes loading them, and
aren't depended on outside core by module name, rather, extensions and
gadgets depend on the styles styles being loaded in a blocking manner on
these pages, which remains unaffected.

Bug: T192623
Change-Id: I6e663dc3c80c7104c9b9abdde44c654543185373

5 years agoMerge "Preferences: Fix timezone selectors"
jenkins-bot [Wed, 16 May 2018 21:58:21 +0000 (21:58 +0000)]
Merge "Preferences: Fix timezone selectors"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 16 May 2018 20:47:27 +0000 (22:47 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Id63d8cbbd732543020b777d068e00cc48657a6bf

5 years agoAPI: Introduce "templated parameters"
Brad Jorsch [Wed, 4 Apr 2018 20:22:01 +0000 (16:22 -0400)]
API: Introduce "templated parameters"

With MCR coming up, ApiEditPage is going to need to be able to take
"text" and "contentmodel" parameters for each slot-role, and enumerating
such parameters for every possible slot would probably get rather
confusing as to what is required when, or at least long-winded in
repeating the exact same thing for every possible role.

So let's abstract it: we'll have an "editroles" parameter to specify which
slots are being edited, and ApiEditPage will just declare that
"text-{role}" and "contentmodel-{role}" parameters should exist for each
value of "editroles" in the submission.

Note this patch doesn't introduce anything that uses templated
parameters, just the functionality itself. For testing purposes you
might cherry pick I2d658e9a.

Bug: T174032
Change-Id: Ia19a1617b73067bfb1f0f16ccc57d471778b7361

5 years agoNames.php: Remove U+200E after autonym of language 'lki'
Fomafix [Wed, 16 May 2018 18:10:05 +0000 (20:10 +0200)]
Names.php: Remove U+200E after autonym of language 'lki'

The LEFT-TO-RIGHT MARK (U+200E) after the RTL autonym of the language
'lki' was inserted in 04fcd20c.

The LRM causes wrong parentheses on mixed bidi sequences on Google
Chrome:
<span dir="rtl">({{#language:lki}}) Foo</span>

Change-Id: I9db84938e2b2142a3cb61955dfcbda790e6bbc5f

5 years agoPreferences: Fix timezone selectors
Ed Sanders [Wed, 16 May 2018 17:10:47 +0000 (18:10 +0100)]
Preferences: Fix timezone selectors

Change-Id: I6a3c4c811361188a9a288cf688f64155b48a906d

5 years agoMerge "parser: Don't unnecessarily add and remove a pipe "
jenkins-bot [Wed, 16 May 2018 16:51:38 +0000 (16:51 +0000)]
Merge "parser: Don't unnecessarily add and remove a pipe "

5 years agoMerge "resourceloader: avoid use of $.globalEval in mediawiki.js"
jenkins-bot [Wed, 16 May 2018 16:40:07 +0000 (16:40 +0000)]
Merge "resourceloader: avoid use of $.globalEval in mediawiki.js"

5 years agoparser: Don't unnecessarily add and remove a pipe
Arlo Breault [Wed, 16 May 2018 15:29:10 +0000 (11:29 -0400)]
parser: Don't unnecessarily add and remove a pipe

Change-Id: I884ab88f9e8ac6f402cd4b3a54e33ccbd30637a2

5 years agoMake Special:TrackingCategories sortable
Raymond [Wed, 16 May 2018 13:39:44 +0000 (15:39 +0200)]
Make Special:TrackingCategories sortable

https://de.wikipedia.org/wiki/Spezial:Tracking-Kategorien is longer
than 1 screen page

Change-Id: Idf2681960bc87f5f189b1666899bd609d74495bb

5 years agoMerge "Deprecate overriding SearchEngine::search*"
jenkins-bot [Wed, 16 May 2018 13:31:56 +0000 (13:31 +0000)]
Merge "Deprecate overriding SearchEngine::search*"

5 years agoMerge "Add missing __METHOD__ to onTransactionPreCommitOrIdle() caller"
jenkins-bot [Wed, 16 May 2018 13:00:35 +0000 (13:00 +0000)]
Merge "Add missing __METHOD__ to onTransactionPreCommitOrIdle() caller"

5 years agoMerge "Deduplicate archive.ar_rev_id"
jenkins-bot [Wed, 16 May 2018 12:53:05 +0000 (12:53 +0000)]
Merge "Deduplicate archive.ar_rev_id"

5 years agoDeduplicate archive.ar_rev_id
Brad Jorsch [Fri, 27 Apr 2018 17:10:36 +0000 (13:10 -0400)]
Deduplicate archive.ar_rev_id

Old bugs and such may have left the archive table with multiple rows
using the same ar_rev_id, or rows that also exist in the revision table.
These need to be cleaned up for MCR.

The maintenance script added here will delete rows that appear to be
duplicates of the same change, and will assign new IDs to rows that do
not appear to be duplicates.

Bug: T193180
Change-Id: I39b0825c9469e074ded3df33a4f06a1ef0edb494

5 years agoMerge "Special:PrefixIndex: Fix regression on prefix input value"
jenkins-bot [Wed, 16 May 2018 07:58:23 +0000 (07:58 +0000)]
Merge "Special:PrefixIndex: Fix regression on prefix input value"

5 years agoMerge "mw.widgets.datetime.DateTimeInputWidget: Increase width"
jenkins-bot [Wed, 16 May 2018 01:09:47 +0000 (01:09 +0000)]
Merge "mw.widgets.datetime.DateTimeInputWidget: Increase width"

5 years agomw.widgets.datetime.DateTimeInputWidget: Increase width
Prateek Saxena [Tue, 15 May 2018 08:41:35 +0000 (14:11 +0530)]
mw.widgets.datetime.DateTimeInputWidget: Increase width

The condition to add extra width for 'strings' was already there
but was putting the same value for both. Increased from 1.15 to
1.25 per character for strings.

Bug: T193907
Change-Id: I474a8a84756d7222a47ef9d4f2d4b50050c4e20e

5 years agoMerge "registration: Improve duplicate config setting exception"
jenkins-bot [Tue, 15 May 2018 23:20:50 +0000 (23:20 +0000)]
Merge "registration: Improve duplicate config setting exception"

5 years agoAdd missing __METHOD__ to onTransactionPreCommitOrIdle() caller
Aaron Schulz [Tue, 15 May 2018 19:52:19 +0000 (12:52 -0700)]
Add missing __METHOD__ to onTransactionPreCommitOrIdle() caller

Change-Id: I3722411dc63ff69253096f9c05e4fd1f130931ae

5 years agoMerge "Make internal search methods private for db implementations"
jenkins-bot [Tue, 15 May 2018 20:09:59 +0000 (20:09 +0000)]
Merge "Make internal search methods private for db implementations"

5 years agoMerge "installer: Don't shell out if it's disabled"
jenkins-bot [Tue, 15 May 2018 19:59:35 +0000 (19:59 +0000)]
Merge "installer: Don't shell out if it's disabled"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 15 May 2018 19:58:24 +0000 (21:58 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I753e6748d026de5a07d3a6b9b07484671059d8db

5 years agoMerge "Populate externallinks.el_index_60 and drop default"
jenkins-bot [Tue, 15 May 2018 19:15:08 +0000 (19:15 +0000)]
Merge "Populate externallinks.el_index_60 and drop default"

5 years agoinstaller: Don't shell out if it's disabled
Kunal Mehta [Tue, 15 May 2018 18:23:38 +0000 (11:23 -0700)]
installer: Don't shell out if it's disabled

Bug: T191947
Change-Id: I16a82d271157cd0024aa14d7eaec80b4870947b5

5 years agoregistration: Improve duplicate config setting exception
Kunal Mehta [Tue, 15 May 2018 17:26:43 +0000 (10:26 -0700)]
registration: Improve duplicate config setting exception

We don't keep track of what set a specific global, so at least mention
the name of the extension that is setting a duplicate for easier
debugging.

Also, fix the case where if the first extension to be loaded was setting
a core setting, it would not throw an exception since config was being
processed before the rest of extension.json. Now we process config after
all core settings, going only before attributes.

Bug: T194319
Change-Id: I4fd96e7d167cf0652ee3e8e66167c86f2b91b992

5 years agoMerge "User: System block reasons shouldn't expand templates"
jenkins-bot [Tue, 15 May 2018 16:21:29 +0000 (16:21 +0000)]
Merge "User: System block reasons shouldn't expand templates"

5 years agoPopulate externallinks.el_index_60 and drop default
Brad Jorsch [Fri, 18 Nov 2016 20:42:11 +0000 (15:42 -0500)]
Populate externallinks.el_index_60 and drop default

Adds a maintenance script to populate the field, has that be
automatically run during update.php, and drops the no-longer-needed
default value on the column (where possible: mssql has some sort of
constraint thing going on that I have no idea how it works).

Bug: T59176
Change-Id: I971edf013a1a39466aca3b6e34c915cb24fd3aa7

5 years agoDeprecate overriding SearchEngine::search*
Erik Bernhardson [Thu, 10 May 2018 20:52:47 +0000 (13:52 -0700)]
Deprecate overriding SearchEngine::search*

The plan is to convert these methods into final, considering
it a removal under the deprecation policy. By making entry
points into the search engine final we provide a guaranteed
point where generic handling can be applied to all search engines.

The first use case for this generic handling is pushing pagination
via overfetch into the SearchEngine class instead of re-implementing
an overfetch in individual parts of the code that perform searches.

Change-Id: I3426d6a2f32d8b368b044b154e1cb70dac007c62

5 years agoMerge "Add setting to control the creation of NullRevision on upload"
jenkins-bot [Tue, 15 May 2018 07:31:09 +0000 (07:31 +0000)]
Merge "Add setting to control the creation of NullRevision on upload"

5 years agoResolve used lazy options in ParserOptions::optionsHash()
Brad Jorsch [Mon, 26 Mar 2018 17:59:24 +0000 (13:59 -0400)]
Resolve used lazy options in ParserOptions::optionsHash()

If a lazy option is passed to ParserOptions::optionsHash(), we should
resolve the option so the hash can incorporate the proper value instead
of omitting it.

Also, completely unrelatedly, refactor the hook overriding in the unit
test because people won't stop whining about it in code review.

Change-Id: I2df78ed90875c229090b503b65f20fbbbba7f237

5 years agoAdd whether user is elevated to unsafe js load log
Brian Wolff [Tue, 15 May 2018 04:14:37 +0000 (04:14 +0000)]
Add whether user is elevated to unsafe js load log

To better triage the log entries.

Change-Id: Idf6d967d06b118ebd7b4d848e12bb36faf55a1b6

5 years agoSpecial:PrefixIndex: Fix regression on prefix input value
Volker E [Sat, 5 May 2018 23:19:08 +0000 (16:19 -0700)]
Special:PrefixIndex: Fix regression on prefix input value

Regression introduced in Ieb9713f8346316e9c3cf1e83eae00848f3921b43

Bug: T193927
Change-Id: I9a3477af89a7e303a67f1769859a649b86113604

5 years agoMerge "Disallow loading JS/CSS/Json subpages from unregistered users and log"
jenkins-bot [Tue, 15 May 2018 01:08:20 +0000 (01:08 +0000)]
Merge "Disallow loading JS/CSS/Json subpages from unregistered users and log"

5 years agoMerge "Better logging for botpasswords"
jenkins-bot [Tue, 15 May 2018 00:59:09 +0000 (00:59 +0000)]
Merge "Better logging for botpasswords"

5 years agoDisallow loading JS/CSS/Json subpages from unregistered users and log
Brian Wolff [Tue, 15 May 2018 00:34:14 +0000 (00:34 +0000)]
Disallow loading JS/CSS/Json subpages from unregistered users and log

Loading JS from an unregistered user's JS subpage is a severe
security risk as someone could potentially register that account
and then modify the JS.

Bug: T194204
Change-Id: I741736e12b0ed49e95f22c869a2b53e2c97b31f0

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 14 May 2018 20:04:40 +0000 (22:04 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I0d75de10ff839f02973bf055e40d65ff7277c102

5 years agoConnectionManager: Require ILoadBalancer instead of LoadBalancer
Thiemo Kreuz [Mon, 14 May 2018 11:27:23 +0000 (13:27 +0200)]
ConnectionManager: Require ILoadBalancer instead of LoadBalancer

Since I4fdf7f7 more code stops returning the implementation, but only
returns the interface. This is a good, very welcome change. However,
ConnectionManager still requires the LoadBalancer implementation, for
no obvious reason. All code in this class works fine with the interface.

This is currently reported by Phan as a violation (and it actually is
one), e.g.:
https://integration.wikimedia.org/ci/job/mwext-php70-phan-docker/6433/console

Change-Id: I63cbb98fd277b0c64ab8b303888b9354c4be29e2

5 years agoMerge "Initial support for Content Security Policy, disabled by default"
jenkins-bot [Mon, 14 May 2018 04:17:15 +0000 (04:17 +0000)]
Merge "Initial support for Content Security Policy, disabled by default"

5 years agoInitial support for Content Security Policy, disabled by default
Brian Wolff [Mon, 29 Feb 2016 04:13:10 +0000 (23:13 -0500)]
Initial support for Content Security Policy, disabled by default

The primary goal here is a defense in depth measure to
stop an attacker who found a bug in the parser allowing
them to insert malicious attributes.

This wouldn't stop someone who could insert a full
script tag (since at current it can't distinguish between
malicious and legit user js). It also would not prevent
DOM-based or reflected XSS for anons, as the nonce value
is guessable for anons when receiving a response cached
by varnish. However, the limited protection of just stopping
stored XSS where the attacker only has control of attributes,
is still a big win in my opinion. (But it wouldn't prevent
someone who has that type of xss from abusing things like
data-ooui attribute).

This will likely break many gadgets. Its expected that any
sort of rollout on Wikimedia will be done very slowly, with
lots of testing and the report-only option to begin with.

This is behind feature flags that are off by default, so
merging this patch should not cause any change in default
behaviour.

This may break some extensions (The most obvious one
is charinsert (See fe648d41005), but will probably need
some testing in report-only mode to see if anything else breaks)

This uses the unsafe-eval option of CSP, in order to
support RL's local storage thingy. For better security,
we may want to remove some of the sillier uses of eval
(e.g. jquery.ui.datepicker.js).

For more info, see spec: https://www.w3.org/TR/CSP2/
Additionally see:
https://www.mediawiki.org/wiki/Requests_for_comment/Content-Security-Policy

Bug: T135963
Change-Id: I80f6f469ba4c0b608385483457df96ccb7429ae5

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 13 May 2018 19:54:52 +0000 (21:54 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I2fe5d9477437629090322b4647bee405ed4ec9e5

5 years agoAdd checkbox in Special:ListUsers to display only users in temporary user groups
Framawiki [Mon, 28 Aug 2017 16:45:49 +0000 (18:45 +0200)]
Add checkbox in Special:ListUsers to display only users in temporary user groups

New checkbox "temporaryGroupsOnly" with new message "listusers-temporarygroupsonly"

Bug: T174313
Change-Id: I388a8aab1145dc958ee110da324aeeb03660ff40

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 12 May 2018 22:28:48 +0000 (00:28 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ibe96d7ea807526ab2df4dc6cad608016b432fe88

5 years agoMinor fixes to CRH language conversion.
C. Scott Ananian [Sat, 12 May 2018 18:37:09 +0000 (14:37 -0400)]
Minor fixes to CRH language conversion.

* Move a many-to-one mapping from the L2C to the C2L table where it
  belongs.

* Fix some regular expression patterns which ended up with misnumbered
  replacement strings.

* All regular expressions should have the `u` (unicode) flag set.

* Typo/spelling fixes in comments

Change-Id: If933fc67845ac994d9ddfdf8349aff445ec9b13a

5 years agoUser: System block reasons shouldn't expand templates
Brad Jorsch [Sat, 12 May 2018 12:03:04 +0000 (08:03 -0400)]
User: System block reasons shouldn't expand templates

The block reasons for "system" blocks shouldn't expand wikitext
templates immediately. That should be left for the code parsing the
block reason for display.

This should only affect how these blocks are reported to API clients, as
when the block is displayed in the web UI it's passed through the parser
anyway. The main drawback, as far as the default messages go, is that
MediaWiki:sorbsreason won't have {{SITENAME}} expanded in
the API response anymore.

Bug: T191939
Change-Id: Ib2024721ea0e26358b9b50efdac16316d6d0f0b6

5 years agoMerge "Use {{int:}} on MediaWiki:Blockedtext and MediaWiki:Autoblockedtext"
jenkins-bot [Sat, 12 May 2018 07:40:54 +0000 (07:40 +0000)]
Merge "Use {{int:}} on MediaWiki:Blockedtext and MediaWiki:Autoblockedtext"

5 years agoresourceloader: avoid use of $.globalEval in mediawiki.js
Aaron Schulz [Thu, 10 May 2018 19:46:23 +0000 (12:46 -0700)]
resourceloader: avoid use of $.globalEval in mediawiki.js

Bug: T192623
Change-Id: Icdd5d76546a6c265a8e941c4e9b28f73bf9dd028

5 years agoMerge "Allow 'all:' on all wikis in addition to 'searchall' translation"
jenkins-bot [Fri, 11 May 2018 22:05:22 +0000 (22:05 +0000)]
Merge "Allow 'all:' on all wikis in addition to 'searchall' translation"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 11 May 2018 19:59:40 +0000 (21:59 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I51c74d19d11c6eda9fbd78aa55eeba4b3e56f1c9

5 years agoresources: Give mediawiki.special.* files their own place in src/
Timo Tijhof [Thu, 10 May 2018 17:38:34 +0000 (18:38 +0100)]
resources: Give mediawiki.special.* files their own place in src/

Bug: T193826
Change-Id: Id25cd18079f48308f6ab42207445bbbd74ed5fda

5 years agoMerge "OOUI prefs: Use late static binding"
jenkins-bot [Fri, 11 May 2018 17:18:08 +0000 (17:18 +0000)]
Merge "OOUI prefs: Use late static binding"

5 years agotablesorter: be more specific about reserving space for header cells
Derk-Jan Hartman [Fri, 11 May 2018 15:21:53 +0000 (17:21 +0200)]
tablesorter: be more specific about reserving space for header cells

They should not be on:
 - unsortable cells
 - tfoot cells
 - descendents cells created by sub tables
Follow up to: If9c8f0974e3a4b08e4a66d37f7f5adf67d73054e

Bug: T194451
Change-Id: I666f66733c2c8c25d3b9e649f4c30864b50a8311

5 years agoMerge "build: update to grunt-contrib-watch@1.0.1 to resolve a vulnerability"
jenkins-bot [Fri, 11 May 2018 16:07:33 +0000 (16:07 +0000)]
Merge "build: update to grunt-contrib-watch@1.0.1  to resolve a vulnerability"

5 years agoMerge "Remove 'patrol' from $wgActionFilteredLogs"
jenkins-bot [Fri, 11 May 2018 15:25:48 +0000 (15:25 +0000)]
Merge "Remove 'patrol' from $wgActionFilteredLogs"

5 years agobuild: update to grunt-contrib-watch@1.0.1 to resolve a vulnerability
Željko Filipin [Fri, 11 May 2018 14:30:32 +0000 (16:30 +0200)]
build: update to grunt-contrib-watch@1.0.1  to resolve a vulnerability

Recommended by `npm audit`.

Moves us from

21 vulnerabilities ... 12 Low | 5 Moderate | 4 High

to

20 vulnerabilities ... 11 Low | 5 Moderate | 4 High

Bug: T194280
Change-Id: I9d6d2fed4ca3d4c43d9b5085873210493081f7e0

5 years agoAllow 'all:' on all wikis in addition to 'searchall' translation
David Causse [Fri, 11 May 2018 13:04:49 +0000 (15:04 +0200)]
Allow 'all:' on all wikis in addition to 'searchall' translation

This allows to have a common syntax useable everywhere.

Bug: T165110
Change-Id: If71fe5df045fb754925946088f8f793197bc8301

5 years agoOOUI prefs: Use late static binding
Ed Sanders [Fri, 11 May 2018 08:55:59 +0000 (09:55 +0100)]
OOUI prefs: Use late static binding

Allow sub-classes to disable OOUI for now (e.g. GlobalPrefs).

Change-Id: Ic3ff878b5f0ba7ec4162fab09fe1b9e10a820095

5 years agoIcuCollation: Use codepoint as tiebreaker when getting first-letters
Bartosz Dziewoński [Tue, 8 May 2018 11:43:10 +0000 (13:43 +0200)]
IcuCollation: Use codepoint as tiebreaker when getting first-letters

This prevents unexpected cuneiform digits from acting as headings for
2 and 3 on category pages.

Bug: T187645
Change-Id: I0424a24769899cb23b28704f97e1002fa44999fd

5 years agoMerge "docs: Rename README to README.md"
jenkins-bot [Thu, 10 May 2018 23:18:46 +0000 (23:18 +0000)]
Merge "docs: Rename README to README.md"

5 years agoMerge "rdbms: use ILoadBalancer in more LBFactory comments"
jenkins-bot [Thu, 10 May 2018 22:26:06 +0000 (22:26 +0000)]
Merge "rdbms: use ILoadBalancer in more LBFactory comments"

5 years agoMerge "resourceloader: Remove use of $.isPlainObject() from mw.Map#set()"
jenkins-bot [Thu, 10 May 2018 20:23:43 +0000 (20:23 +0000)]
Merge "resourceloader: Remove use of $.isPlainObject() from mw.Map#set()"

5 years agoresourceloader: Remove use of $.isPlainObject() from mw.Map#set()
Timo Tijhof [Mon, 7 May 2018 22:34:20 +0000 (23:34 +0100)]
resourceloader: Remove use of $.isPlainObject() from mw.Map#set()

Look for typeof 'object' instead. The set() method has good test
coverage which uncovered a few cases that were previously only
working implicitly due to isPlainObject.

* Test case `mw.config.set( [], 'value' )`
  This is invalid because `key` must be a string. This was previously
  rejected because while array is an object, it isn't a plain object.
  This commit intends to remove this distinction and allow any object
  to be used with the set(Object) signature. However, we should still
  reject set(non-string, string) no matter what kind of object is passed.

  Changing from isPlainObject to 'is an object' made this case
  wrongly pass instead of fail (because arrays are objects). Fix that,
  as well as any other case of non-string as key, by making the code
  explicitly reject non-string keys when two arguments are given.

  Added test case for `mw.config.set( {}, value ) === false` that did
  not pass without the changes in src/.

* Missing `> 1` check in global #set(). The check for arguments.length
  was asserting truthiness (non-zero) rather than >1 (2 or more).
  This was causing things like `mw.config.set('key')` to throw
  "ReferenceError: value not defined" when the underlying mw.Map
  is global. The normal #set() method for maps other than mw.config,
  was already fine.

  Fixed a bug in mediawiki.language.init that was revealed by this.
  The bug was not happening previously because when an object
  was passed, the second parameter was ignored.

Bug: T192623
Change-Id: Ib53647b324fe3d31e3389ed9aa14a08280d9c830

5 years agoMerge "Localisation updates from https://translatewiki.net."
L10n-bot [Thu, 10 May 2018 20:03:34 +0000 (20:03 +0000)]
Merge "Localisation updates from https://translatewiki.net."

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 10 May 2018 20:03:24 +0000 (22:03 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I6b9a40e5d652ca8ff935546721309e07b2f7dd0b

5 years agoLogPager/LogEventsList: Correct docs about $pattern parameter
Bartosz Dziewoński [Mon, 7 May 2018 18:48:01 +0000 (20:48 +0200)]
LogPager/LogEventsList: Correct docs about $pattern parameter

$pattern is a boolean, it is documented as "Do a prefix search rather
than an exact title match". However, its type was incorrectly
documented to be a string, and the default value was '' instead of
false (which was harmless, as it is correctly treated as a boolean
value everywhere).

Change-Id: Id093d12891a231d5934f9908e619065afff7380e

5 years agoMerge "mediawiki.skinning: Only apply tright/tleft margins to frame/thumb"
jenkins-bot [Thu, 10 May 2018 19:34:14 +0000 (19:34 +0000)]
Merge "mediawiki.skinning: Only apply tright/tleft margins to frame/thumb"

5 years agoMerge "rdbms: fix callback stage errors in LBFactory::commitMasterChanges"
jenkins-bot [Thu, 10 May 2018 19:07:18 +0000 (19:07 +0000)]
Merge "rdbms: fix callback stage errors in LBFactory::commitMasterChanges"

5 years agomediawiki.skinning: Only apply tright/tleft margins to frame/thumb
Arlo Breault [Thu, 3 May 2018 17:07:39 +0000 (13:07 -0400)]
mediawiki.skinning: Only apply tright/tleft margins to frame/thumb

The other formats should correspond to the margins for
floatright/floatleft.

Bug: T193695
Change-Id: I19ff964bcac486e8d45e7deab40f9220295bf9f6

5 years agoMerge "build: Update Karma to v2.0.2"
jenkins-bot [Thu, 10 May 2018 18:28:49 +0000 (18:28 +0000)]
Merge "build: Update Karma to v2.0.2"

5 years agoMerge "Set the package type to 'mediawiki-core'"
jenkins-bot [Thu, 10 May 2018 16:48:11 +0000 (16:48 +0000)]
Merge "Set the package type to 'mediawiki-core'"

5 years agoBetter logging for botpasswords
Brian Wolff [Thu, 10 May 2018 01:52:18 +0000 (01:52 +0000)]
Better logging for botpasswords

As its an authentication action, its important to log when
somebody creates a new botpassword.

Bug: T194204
Change-Id: Ib8dc634b77ae9e42e3d225be1d56e6d04e9595b1

5 years agoMerge "Create update SPARQL for category changes"
jenkins-bot [Thu, 10 May 2018 15:59:02 +0000 (15:59 +0000)]
Merge "Create update SPARQL for category changes"

5 years agobuild: Update Karma to v2.0.2
Željko Filipin [Thu, 10 May 2018 15:04:32 +0000 (17:04 +0200)]
build: Update Karma to v2.0.2

The current version has a couple of dependencies with high severity
vulnerabilities.

Bug: T194280
Change-Id: I3f9f36a6a5c2ba1716b91d14e59bc60f9e0ff513

5 years agodocs: Rename README to README.md
Timo Tijhof [Thu, 10 May 2018 14:56:39 +0000 (15:56 +0100)]
docs: Rename README to README.md

The only wikitext-speficic syntax in here is the title.

Renaming this to Markdown has various benefits:

* Makes the README render properly on Gitiles, Doxygen, and Diffusion.
  The current README is not renderable in Gitiles or Doxygen.

* More familiar to new contributors in open-source.

* Consistent with other documentation content we maintain within Git,
  including all PHP and JS documentation, which via JSDoc/JSDuck/Doxygen
  have all their descriptions parsed in Markdown.

* Rich previews and syntax highlighting in many text editors
  and Git viewers.

Change-Id: I5bade76528fa3d870334d960c39db009644bb58f

5 years agoMerge "build: Update Karma's qunit from 2.5.0 to 2.6.0"
jenkins-bot [Thu, 10 May 2018 14:36:33 +0000 (14:36 +0000)]
Merge "build: Update Karma's qunit from 2.5.0 to 2.6.0"

5 years agobuild: Update Karma's qunit from 2.5.0 to 2.6.0
Timo Tijhof [Thu, 10 May 2018 13:12:17 +0000 (14:12 +0100)]
build: Update Karma's qunit from 2.5.0 to 2.6.0

Follows-up 065b21b4bd which updated the copy of QUnit used
on Special:JavaScriptTest.

Change-Id: I24b17c9c266f58d48caa9c3392496c469b3ddba0

5 years agoFix a critical NPM package vulnerability
Željko Filipin [Thu, 10 May 2018 12:13:45 +0000 (14:13 +0200)]
Fix a critical NPM package vulnerability

NPM v6 audits packages during installation. This is the only critical vulnerability.

Bug: T194280
Change-Id: I5fe35067919ad67b9781701136e290eda17c3afa

5 years agoStrip Unicode 6.3.0 directional formatting characters from title
Fomafix [Thu, 22 Mar 2018 10:48:55 +0000 (11:48 +0100)]
Strip Unicode 6.3.0 directional formatting characters from title

Unicode 6.3.0 (September 2013) the added additional directional
formatting characters:

U+061C ARABIC LETTER MARK
U+2066 LEFT-TO-RIGHT ISOLATE
U+2067 RIGHT-TO-LEFT ISOLATE
U+2068 FIRST STRONG ISOLATE
U+2069 POP DIRECTIONAL ISOLATE

https://www.fileformat.info/info/unicode/version/6.3/index.htm

This change strips the new directional formatting characters from the
title like the directional formatting characters from Unicode 1.1.0
(June 1993).

Any existing titles containing the new Unicode directional formatting
characters get stripped by a run of maintenance/cleanupTitles.php after
deployment.

This change also allows to insert the new Unicode directional
formatting characters into the DISPLAYTITLE.

Change-Id: I2279f51048f5252c2e4280ec6a13f060ff9967cb

5 years agoStrip soft hyphens (U+00AD) from title
Fomafix [Sat, 25 Nov 2017 20:02:55 +0000 (21:02 +0100)]
Strip soft hyphens (U+00AD) from title

This change strips all soft hyphens from the title. This is already
done for Unicode bidi characters (T5696).

URLs with soft hyphens (%C2%AD) get redirected (301) to the URL without
soft hyphens (T145605):
https://de.wikipedia.org/wiki/Bosnatal%C2%ADbahn get redirected to
https://de.wikipedia.org/wiki/Bosnatalbahn

Links in wikitext containing soft hyphen "[[Bosnatal<AD>bahn]]" (the
"<AD>" stands here for a soft hyphen) links "Bosnatalbahn" but displays
"Bosnatal<AD>bahn".

This change also allows to insert soft hyphens into the displaytitle
(T66528). This allows to insert soft hyphens into the first heading for
manual hyphenation of titles with very long words.

This change prevents access to any existing articles containing soft
hyphens in the title. After deploying this change a run of
maintenance/cleanupTitles.php must performed to rename existing titles
with soft hyphens. Before deploying this change existing articles and
redirects with soft hyphens in the title can already renamed or
deleted.

Bug: T121979
Bug: T66528
Change-Id: Ie13626c433cdb460dbf00b3bba28d1bb5a7b6d6a

5 years agordbms: fix callback stage errors in LBFactory::commitMasterChanges
Aaron Schulz [Thu, 10 May 2018 04:14:40 +0000 (21:14 -0700)]
rdbms: fix callback stage errors in LBFactory::commitMasterChanges

Just like 082ed053b6 fixed pre-commit callback errors when new instances
of LoadBalancer are made during that step, do the same for post-commit
callbacks.

Bug: T194308
Change-Id: Ie79e0f22b3aced425cf067d0df6b67e368223e6c

5 years agordbms: use ILoadBalancer in more LBFactory comments
Aaron Schulz [Thu, 10 May 2018 04:25:38 +0000 (21:25 -0700)]
rdbms: use ILoadBalancer in more LBFactory comments

Change-Id: I4fdf7f77df266e8a025930f01760b797c996bc69

5 years agomakeCollapsible: fix state of nested collapsibles
Derk-Jan Hartman [Tue, 8 May 2018 20:46:56 +0000 (22:46 +0200)]
makeCollapsible: fix state of nested collapsibles

When collapsing or expanding an element which has nested other
collapsibles, the labels of all nested toggles were updating to the
value of the parent, while their state was not.

Apply to the specific toggle only, just as the classes are applied to
just the specific toggle.

Bug: T168689
Change-Id: I1c3c29dc9ca4ccbf8da83796e56964a7a6d58a81

5 years agoMerge "resources: Move the remaining src/mediawiki/ files"
jenkins-bot [Wed, 9 May 2018 23:45:02 +0000 (23:45 +0000)]
Merge "resources: Move the remaining src/mediawiki/ files"

5 years agoresources: Move the remaining src/mediawiki/ files
Timo Tijhof [Wed, 9 May 2018 20:36:06 +0000 (21:36 +0100)]
resources: Move the remaining src/mediawiki/ files

Single-file modules to src/, the remaining as sub directories.

A few highlights:
* mediawiki.Upload.BookletLayout. (stylesheet: no image references)
* mediawiki.feedback - Also move the image to its own images/ subdir.
* mediawiki.searchSuggest. (stylesheet: no image references)
* mediawiki.toc. (stylesheet: no image references)

Also updated any other references to 'src/mediawiki/' that I could find
in core:
* Fixed references in docs/uidesign/*.html
* Remove redundant exclude from jsduck.json.

After this, there are 4 files remaining in src/mediawiki,
which are the 4 files used by the actual 'mediawiki' base module.

Bug: T193826
Change-Id: I8058652892a78b3f5976397bd850741dd5c92427

5 years agoMerge "rdbms: rename onTransactionIdle() to onTransactionCommitOrIdle()"
jenkins-bot [Wed, 9 May 2018 22:36:44 +0000 (22:36 +0000)]
Merge "rdbms: rename onTransactionIdle() to onTransactionCommitOrIdle()"

5 years agoskins: Update core skins to queue modules via getDefaultModules()
Timo Tijhof [Fri, 4 May 2018 00:23:39 +0000 (01:23 +0100)]
skins: Update core skins to queue modules via getDefaultModules()

Following I3404c1c2a7e, update the core skins to use
getDefaultModules() instead of the now-deprecated setupSkinUserCss().

Change-Id: I48b76938f46c1b6b683b618e7571e6fc6876cc52

5 years agoMerge "rdbms: fix LBFactory::commitAll() round handling"
jenkins-bot [Wed, 9 May 2018 22:07:46 +0000 (22:07 +0000)]
Merge "rdbms: fix LBFactory::commitAll() round handling"

5 years agordbms: fix LBFactory::commitAll() round handling
Aaron Schulz [Wed, 9 May 2018 21:44:34 +0000 (14:44 -0700)]
rdbms: fix LBFactory::commitAll() round handling

This avoids "Transaction round stage must be approved (not cursory)".

Bug: T194308
Change-Id: I9dbfe9cede02b1b1904c1d5e5a9802306c2492a2

5 years agoMerge "mediawiki.htmlform: Move files to their own module directory"
jenkins-bot [Wed, 9 May 2018 21:25:43 +0000 (21:25 +0000)]
Merge "mediawiki.htmlform: Move files to their own module directory"

5 years agordbms: rename onTransactionIdle() to onTransactionCommitOrIdle()
Aaron Schulz [Wed, 9 May 2018 02:28:39 +0000 (19:28 -0700)]
rdbms: rename onTransactionIdle() to onTransactionCommitOrIdle()

This is clearer and is consistent with onTransactionPreCommitOrIdle()

Change-Id: I3a34a0e9adea69ec55ed6ddfef47703e31e7c3b5

5 years agoMerge "Add default edit rate limit of 90 edits/minute for all users"
jenkins-bot [Wed, 9 May 2018 21:00:52 +0000 (21:00 +0000)]
Merge "Add default edit rate limit of 90 edits/minute for all users"

5 years agomediawiki.htmlform: Move files to their own module directory
Timo Tijhof [Wed, 9 May 2018 19:10:05 +0000 (20:10 +0100)]
mediawiki.htmlform: Move files to their own module directory

* mediawiki.htmlform.styles:
  - mediawiki/htmlform/styles.css
  - mediawiki/htmlform/images/*
    Only contains two images, only used by this module.

* mediawiki.htmlform.checker.js.

* mediawiki.htmlform.ooui: Only Element.js.

* mediawiki.htmlform.ooui.styles.less.

* mediawiki.htmlform: Other files from mediawiki/htmlform.

Bug: T193826
Change-Id: I5c057c758933e905d5c7940ade5bf43282088159

5 years agoAdd default edit rate limit of 90 edits/minute for all users
Brian Wolff [Wed, 9 May 2018 20:43:51 +0000 (20:43 +0000)]
Add default edit rate limit of 90 edits/minute for all users

Previously there was no rate limit at all if you were autoconfirmed.

This initial setting is set on the high end of things, we may
adjust later. See also T192668, T194204.

Change-Id: I7cb002900bae2da3f4f4758671186659c1720e1d

5 years agoRemove 'patrol' from $wgActionFilteredLogs
Amir Sarabadani [Tue, 8 May 2018 21:11:51 +0000 (23:11 +0200)]
Remove 'patrol' from $wgActionFilteredLogs

We disabled logging autopatrol actions and we are deleting them.
Thus having patrol subtypes filters in Special:Log doesn't make
sense anymore.

Bug: T194213
Change-Id: I421ee54040cd2b64e53f1e68016c74a163d89ed3

5 years agoMerge "Remove width restriction on gadget labels"
jenkins-bot [Wed, 9 May 2018 20:17:26 +0000 (20:17 +0000)]
Merge "Remove width restriction on gadget labels"

5 years agoMerge "mediawiki.page.gallery.styles: Move files to src/"
jenkins-bot [Wed, 9 May 2018 20:17:23 +0000 (20:17 +0000)]
Merge "mediawiki.page.gallery.styles: Move files to src/"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 9 May 2018 20:16:02 +0000 (22:16 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I7ca3a4f519cab7221f8e37c50baf2f6e666fa70e