lhc/web/wiklou.git
7 years agoPin eslint version
Paladox [Sun, 18 Dec 2016 16:29:41 +0000 (16:29 +0000)]
Pin eslint version

We don't want tests failing every time upstream publishing a new
version.

Instead we should bump this manually everytime they update to make sure
no failures happen.

Bug: T118941
Change-Id: I1c76dacd0950100825b85a3791f74c1f6d5477d9

7 years agoMerge "upload: Avoid &$this in hooks"
jenkins-bot [Tue, 20 Dec 2016 23:36:15 +0000 (23:36 +0000)]
Merge "upload: Avoid &$this in hooks"

7 years agoupload: Avoid &$this in hooks
rlot [Tue, 20 Dec 2016 15:49:15 +0000 (16:49 +0100)]
upload: Avoid &$this in hooks

&$this triggers warnings in PHP 7.1. Simply renaming the variable before
passing it by reference avoids the warning, without breaking backwards
compatibility.

Bug: T153505
Change-Id: I78ea04a01ecce82294837e92c2a05b00ffb6e0f6

7 years agoProtect -{...}- variant constructs in galleries
C. Scott Ananian [Wed, 21 Sep 2016 18:25:26 +0000 (14:25 -0400)]
Protect -{...}- variant constructs in galleries

This also protects naked external links, which are internally surrounded by
`-{R|...}-` by LanguageConverter::markNoConversion.

Originally found in failed tests in I7fa2d85d6.

Bug: T54190
Change-Id: I9b099273203482ffb570a5654d8ba50c833e526d

7 years agoProtect -{...}- variant constructs in images.
C. Scott Ananian [Tue, 13 Dec 2016 19:49:36 +0000 (14:49 -0500)]
Protect -{...}- variant constructs in images.

A protected version of explode is factored out as
`StringUtils::delimiterExplode`, since it will be used in follow-up
patches in this series.  The `delimiterExplode` implementation creates
an intermediate array of the exploded results, which is reasonable as
the number of image options is small; but since an Iterator is
returned the implementation can be upgraded in the future (at the cost
of additional complexity) to avoid this.  The additional code in that
case would be similar to ExplodeIterator.

Bug: T146305
Change-Id: I1327685e9e8c07ef476dceaa6f6dae4ba40989ef

7 years agoMerge "Pass undone revision id to PageContentSaveComplete hook"
jenkins-bot [Tue, 20 Dec 2016 19:01:07 +0000 (19:01 +0000)]
Merge "Pass undone revision id to PageContentSaveComplete hook"

7 years agoUpdate date format for Wu language
MarcoAurelio [Fri, 9 Dec 2016 10:21:34 +0000 (11:21 +0100)]
Update date format for Wu language

Bug: T125047
Change-Id: I398d93d372ad0d5345b0e4b27657ad69b0079d94

7 years agoMerge "Fix RevDel API output for formatversion=2"
jenkins-bot [Mon, 19 Dec 2016 23:06:49 +0000 (23:06 +0000)]
Merge "Fix RevDel API output for formatversion=2"

7 years agoMerge "ApiEditPage: Avoid PHP warning"
jenkins-bot [Mon, 19 Dec 2016 23:04:47 +0000 (23:04 +0000)]
Merge "ApiEditPage: Avoid PHP warning"

7 years agoMerge "Remove unused Phan exception"
jenkins-bot [Mon, 19 Dec 2016 21:31:03 +0000 (21:31 +0000)]
Merge "Remove unused Phan exception"

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 19 Dec 2016 20:56:18 +0000 (21:56 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I905f195a2d4a159bf4f9cb3357465ce96c59f2ce

7 years agoDo not exit the run method in case of a missing rev
David Causse [Mon, 19 Dec 2016 17:37:01 +0000 (18:37 +0100)]
Do not exit the run method in case of a missing rev

We should ignore broken/missing titles and not stop the whole process.

Change-Id: Ib4acb739c28c5f3278430b43b6304af3a513085e

7 years agoFix RevDel API output for formatversion=2
Brad Jorsch [Mon, 19 Dec 2016 16:36:09 +0000 (11:36 -0500)]
Fix RevDel API output for formatversion=2

Use booleans, not the old empty-string-or-undefined.

This bugfix is a breaking change, but chances are it won't affect many
clients.

Bug: T153518
Change-Id: If5fa2cdcb973b186349307b29e4266daceef0a9d

7 years agoPass undone revision id to PageContentSaveComplete hook
cenarium [Sun, 18 Dec 2016 02:06:42 +0000 (03:06 +0100)]
Pass undone revision id to PageContentSaveComplete hook

This passes the id of the revision that was undone to the
PageContentSaveComplete hook, since this hook is now inside a deferred
update so extensions can no longer rely on 'wpUndidRevision' being
present in the request.

Change-Id: I50dcb841cd0616acc2d69c3a685ba3cb339986c3

7 years agoApiEditPage: Avoid PHP warning
Brad Jorsch [Mon, 19 Dec 2016 14:49:59 +0000 (09:49 -0500)]
ApiEditPage: Avoid PHP warning

In cases where $result is non-null but doesn't have the 'spam' key,
constructing the fallback array was raising a PHP warning.

Thinking it over, we should just use a switch instead of making an array
of known fallback messages. It's longer source code, but probably less
real work than constructing an array where only one entry will actually
be used.

Bug: T153590
Change-Id: I50349c56692c4b2f9a8e560a849c36db1082120e

7 years agoMerge "build: Update phpunit to 4.8.31"
jenkins-bot [Sun, 18 Dec 2016 23:07:03 +0000 (23:07 +0000)]
Merge "build: Update phpunit to 4.8.31"

7 years agoMerge "Move the Ukrainian grammar rules from PHP and JS to JSON"
jenkins-bot [Sun, 18 Dec 2016 23:04:48 +0000 (23:04 +0000)]
Merge "Move the Ukrainian grammar rules from PHP and JS to JSON"

7 years agobuild: Update phpunit to 4.8.31
Paladox [Tue, 31 May 2016 14:34:00 +0000 (15:34 +0100)]
build: Update phpunit to 4.8.31

Please see changelog at
https://github.com/sebastianbergmann/phpunit/blob/4.8/ChangeLog-4.8.md

Change-Id: I00e0b94452b371cacecc4eb10330749c0da1890e

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 18 Dec 2016 20:54:06 +0000 (21:54 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I6f343baa88923fcc11e83a066edb01cab77986ec

7 years agoHTMLForm: Use 'mw-htmlform' CSS class
Bartosz Dziewoński [Fri, 2 Dec 2016 19:19:07 +0000 (20:19 +0100)]
HTMLForm: Use 'mw-htmlform' CSS class

Makes it easy to identify all HTMLForms on a page.

Change-Id: I5b9494fc925ac953c14b358331acddfe80c2661d

7 years agoHTMLFormFieldCloner: Set 'formnovalidate' on add/remove field buttons
Bartosz Dziewoński [Fri, 2 Dec 2016 17:28:30 +0000 (18:28 +0100)]
HTMLFormFieldCloner: Set 'formnovalidate' on add/remove field buttons

Otherwise, after we allow HTML5 form validation attributes, these
buttons wouldn't work for non-JS users (unless the whole form was
otherwise valid).

Change-Id: Ia9c16849774c186b991280ea60fc5608ddd4cf42

7 years agoMerge "Rewrite importImages.php to use Maintenance infrastructure"
jenkins-bot [Sun, 18 Dec 2016 12:58:14 +0000 (12:58 +0000)]
Merge "Rewrite importImages.php to use Maintenance infrastructure"

7 years agoMerge "mw.htmlform: Fields hidden with 'hide-if' should be disabled"
jenkins-bot [Sun, 18 Dec 2016 12:56:11 +0000 (12:56 +0000)]
Merge "mw.htmlform: Fields hidden with 'hide-if' should be disabled"

7 years agoMerge "Turn $wgRunJobsAsync off by default"
jenkins-bot [Sun, 18 Dec 2016 12:49:32 +0000 (12:49 +0000)]
Merge "Turn $wgRunJobsAsync off by default"

7 years agoRemove unused Phan exception
Max Semenik [Fri, 16 Dec 2016 19:23:44 +0000 (11:23 -0800)]
Remove unused Phan exception

Change-Id: Ib578336abfed02c8dce9ccb47ab22220ddcee856

7 years agoRewrite importImages.php to use Maintenance infrastructure
Max Semenik [Fri, 16 Dec 2016 22:45:20 +0000 (14:45 -0800)]
Rewrite importImages.php to use Maintenance infrastructure

I even tested it!

Change-Id: I999f5842625c752f01c1eb4b012431c4a24ce7ce

7 years agoMerge "Move TempFileRepo to a separate file"
jenkins-bot [Sun, 18 Dec 2016 12:18:35 +0000 (12:18 +0000)]
Merge "Move TempFileRepo to a separate file"

7 years agoTurn $wgRunJobsAsync off by default
Jesús Martínez Novo [Thu, 25 Aug 2016 14:07:57 +0000 (16:07 +0200)]
Turn $wgRunJobsAsync off by default

The current situation doesn't work in all installations and has being worse
since MediaWiki 1.27. Default settings should be safe in all installations,
and $wgRunJobsAsync wasn't one of them.

Bug: T142751
Change-Id: I8daa38534a0e925a75ba2fb47e3e299f1baee4b1

7 years agoMove the Ukrainian grammar rules from PHP and JS to JSON
Amir E. Aharoni [Sun, 11 Oct 2015 19:35:28 +0000 (22:35 +0300)]
Move the Ukrainian grammar rules from PHP and JS to JSON

Bug: T115217
Change-Id: I15a06b07e381cc9074e64e746d22ec51e9e638c4

7 years agoMerge "Make the code for grammar data processing common"
jenkins-bot [Sun, 18 Dec 2016 11:06:38 +0000 (11:06 +0000)]
Merge "Make the code for grammar data processing common"

7 years agoMerge "Optionally collect context in TestLogger"
jenkins-bot [Sun, 18 Dec 2016 10:02:59 +0000 (10:02 +0000)]
Merge "Optionally collect context in TestLogger"

7 years agoMove TempFileRepo to a separate file
Aaron Schulz [Sat, 17 Dec 2016 09:12:32 +0000 (01:12 -0800)]
Move TempFileRepo to a separate file

Change-Id: I6fc0870cc82a7b19859abc00bd4b2ecee6c0fc9e

7 years agoMerge "Add dotall modifier to EDITSECTION_REGEX"
jenkins-bot [Sun, 18 Dec 2016 02:53:47 +0000 (02:53 +0000)]
Merge "Add dotall modifier to EDITSECTION_REGEX"

7 years agoMerge "mediawiki.special.watchlist: Fix render stampede after "Mark all pages visited""
jenkins-bot [Sat, 17 Dec 2016 22:35:07 +0000 (22:35 +0000)]
Merge "mediawiki.special.watchlist: Fix render stampede after "Mark all pages visited""

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 17 Dec 2016 20:53:03 +0000 (21:53 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I649e54c975f5fe8445821e53ef121ec088167ca9

7 years agoMerge "Fixing mediawiki's য় problem"
jenkins-bot [Sat, 17 Dec 2016 15:40:12 +0000 (15:40 +0000)]
Merge "Fixing mediawiki's য় problem"

7 years agoFix deprecation message - use correct method name (defaultPrefixSearch)
Stanislav Malyshev [Fri, 16 Dec 2016 23:04:14 +0000 (15:04 -0800)]
Fix deprecation message - use correct method name (defaultPrefixSearch)

Change-Id: Ie4dbb28b4ca11ecfeaccd331db55f92130f6cdf1

7 years agoMerge "mediawiki.api.watch: Use formatversion=2 for API requests"
jenkins-bot [Sat, 17 Dec 2016 06:55:58 +0000 (06:55 +0000)]
Merge "mediawiki.api.watch: Use formatversion=2 for API requests"

7 years agoMerge "user: Minor clean up of User::isLocallyBlockedProxy()"
jenkins-bot [Sat, 17 Dec 2016 06:42:10 +0000 (06:42 +0000)]
Merge "user: Minor clean up of User::isLocallyBlockedProxy()"

7 years agoMerge "Fix various minor IDEA warnings in LoadBalancer"
jenkins-bot [Sat, 17 Dec 2016 06:41:34 +0000 (06:41 +0000)]
Merge "Fix various minor IDEA warnings in LoadBalancer"

7 years agouser: Minor clean up of User::isLocallyBlockedProxy()
Timo Tijhof [Sat, 17 Dec 2016 06:09:06 +0000 (22:09 -0800)]
user: Minor clean up of User::isLocallyBlockedProxy()

Change-Id: If8bcb2f26f14ce04ee23fb9500be95c8cdf1a967

7 years agomediawiki.special.watchlist: Fix render stampede after "Mark all pages visited"
Timo Tijhof [Sat, 17 Dec 2016 05:47:28 +0000 (21:47 -0800)]
mediawiki.special.watchlist: Fix render stampede after "Mark all pages visited"

Follow-up 9ea1142fadf4d70ceedc73592aea1c.

The progress bar has a continuous animation that is rather CPU heavy.
While it is set to 'visibility hidden', this is merely a way to make the
contents of the element transparent. It is still interactable (e.g. if it
has hover or click handlers, they would trigger if hovering in that area)
and still rendered with full 60fps paint and layout.

Instead, detach and (re-)append the element as needed. Since the element
has an absolute position, it doesn't cause a content reflow when the element
is detached. This fact is already made use of considering the element is
inserted only after the submit button is clicked - without content reflow.

Change-Id: I06ef0d527044e5a6080febdb618eaffeb6ec85fa

7 years agoMerge "Change linking Special:PageLanguage on action=info"
jenkins-bot [Sat, 17 Dec 2016 05:14:18 +0000 (05:14 +0000)]
Merge "Change linking Special:PageLanguage on action=info"

7 years agoMerge "mediawiki.searchSuggest: Remove inline browser compat check"
jenkins-bot [Sat, 17 Dec 2016 03:17:10 +0000 (03:17 +0000)]
Merge "mediawiki.searchSuggest: Remove inline browser compat check"

7 years agoMerge "Adjust phan script to run sub-projects"
jenkins-bot [Sat, 17 Dec 2016 03:17:06 +0000 (03:17 +0000)]
Merge "Adjust phan script to run sub-projects"

7 years agoMerge "SearchInputWidget: Support searching a namespaces besides 0"
jenkins-bot [Sat, 17 Dec 2016 02:25:03 +0000 (02:25 +0000)]
Merge "SearchInputWidget: Support searching a namespaces besides 0"

7 years agoMerge "mediawiki.api: Add test for api deferred rejection of errorformat!=bc"
jenkins-bot [Sat, 17 Dec 2016 01:57:58 +0000 (01:57 +0000)]
Merge "mediawiki.api: Add test for api deferred rejection of errorformat!=bc"

7 years agoMerge "jquery.tipsy: Remove support for 'live' option"
jenkins-bot [Sat, 17 Dec 2016 01:48:46 +0000 (01:48 +0000)]
Merge "jquery.tipsy: Remove support for 'live' option"

7 years agomediawiki.api: Add test for api deferred rejection of errorformat!=bc
Matthias Mullie [Fri, 16 Dec 2016 07:30:43 +0000 (08:30 +0100)]
mediawiki.api: Add test for api deferred rejection of errorformat!=bc

Change-Id: Ia4e1d575e07df690919d63502f9fedffff7be0a3

7 years agojquery.tipsy: Remove support for 'live' option
Bartosz Dziewoński [Mon, 25 Jul 2016 11:37:45 +0000 (13:37 +0200)]
jquery.tipsy: Remove support for 'live' option

Follows-up aa524075ac from 2014.

It was relying on jQuery features that have been deprecated a long time
ago, officially removed in jQuery 1.11, and removed for real in 3.0.
We have to get rid of it at some point. As far as I can tell, nothing
in our repositories uses this option anymore.

Rather than remove the code and diverge further from upstream Tipsy,
I'm just making it throw an error if this is passed. Maybe one day we'll
upgrade Tipsy too to some modern version and this will then disappear.

Bug: T85048
Change-Id: I7dca8334556b1079cd4fee2e6e921232fe3d46ef

7 years agomediawiki.searchSuggest: Remove inline browser compat check
Timo Tijhof [Sat, 17 Dec 2016 01:22:52 +0000 (17:22 -0800)]
mediawiki.searchSuggest: Remove inline browser compat check

Introduced in 1f987fb5eea4.

This is quite dated and obsolete since then. The current code in
the 'mediawiki.searchSuggest' and 'jquery.suggestions' works fine
in all currently supported Grade A browsers (per startup.js).

Change-Id: I6d281459e230fa6a2971a31314f9e963dc83ff2b

7 years agoMerge "Fix type annotation"
jenkins-bot [Sat, 17 Dec 2016 01:29:08 +0000 (01:29 +0000)]
Merge "Fix type annotation"

7 years agoMerge "tests: Fix broken setup/teardown in mediawiki.language.test.js"
jenkins-bot [Sat, 17 Dec 2016 01:28:36 +0000 (01:28 +0000)]
Merge "tests: Fix broken setup/teardown in mediawiki.language.test.js"

7 years agoAdjust phan script to run sub-projects
Erik Bernhardson [Sat, 17 Dec 2016 01:16:04 +0000 (17:16 -0800)]
Adjust phan script to run sub-projects

Rather than duplicating the phan and postprocess-phan.php scripts
into extensions, this allows passing the path to the extension
(or skin, or whichever) to the phan script and it will run the analysis
for that project.

Individual projects will need a tests/phan/config.php file that defines
how the analysis will run in their project.

Bug: T153040
Change-Id: I58ad44f6a8769088e87d5d6cf1079e633c082f88

7 years agoSearchInputWidget: Support searching a namespaces besides 0
Kunal Mehta [Sat, 17 Dec 2016 00:09:02 +0000 (16:09 -0800)]
SearchInputWidget: Support searching a namespaces besides 0

0 is currently hardcoded in searchSuggest, making it hard to use
SearchInputWidget for other things.

SearchInputWidget already takes a namespace parameter by virtue of
extending TitleInputWidget, so use that.

Change-Id: Iecf93d1e8d4075a5a9aa0f08059c609aa8db4f6d

7 years agoFix type annotation
Max Semenik [Sat, 17 Dec 2016 00:55:58 +0000 (16:55 -0800)]
Fix type annotation

Change-Id: I8996a7617c4723c9c4ff8f91d0f3767c9e67dd28

7 years agotests: Fix broken setup/teardown in mediawiki.language.test.js
Timo Tijhof [Sat, 17 Dec 2016 00:55:33 +0000 (16:55 -0800)]
tests: Fix broken setup/teardown in mediawiki.language.test.js

Ref T152476.

Change-Id: Ie871d36dadefd69d0a5dc85c275b55d4d477dc78

7 years agoMerge "registration: Always specify version number in extension.schema.json file"
jenkins-bot [Sat, 17 Dec 2016 00:54:55 +0000 (00:54 +0000)]
Merge "registration: Always specify version number in extension.schema.json file"

7 years agoMerge "Remove deprecated function User::isPasswordReminderThrottled()"
jenkins-bot [Fri, 16 Dec 2016 21:11:39 +0000 (21:11 +0000)]
Merge "Remove deprecated function User::isPasswordReminderThrottled()"

7 years agoMerge "Remove 2 deprecated functions from class User"
jenkins-bot [Fri, 16 Dec 2016 21:06:15 +0000 (21:06 +0000)]
Merge "Remove 2 deprecated functions from class User"

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 16 Dec 2016 20:59:51 +0000 (21:59 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I586676d3574c23e6746b7673664734ae66eb7984

7 years agoRemove deprecated function User::isPasswordReminderThrottled()
Max Semenik [Fri, 16 Dec 2016 00:23:10 +0000 (16:23 -0800)]
Remove deprecated function User::isPasswordReminderThrottled()

Deprecated and stubbed in 1.27, only throws exceptions these days.
The only user in core or extensions is AjaxLogin which is completely
broken anyway (T153385).

Change-Id: I298fbc3e65d98b3af2f3cfef3d9884e277e6717c

7 years agoRemove 2 deprecated functions from class User
Max Semenik [Fri, 16 Dec 2016 00:10:03 +0000 (16:10 -0800)]
Remove 2 deprecated functions from class User

They've been deprecated in 1.27 and only throw exceptions
no callers in core or extensions.

Change-Id: I1ccfa39c287b640b435a075449e4674daf8d24e7

7 years agoMerge "WatchedItemStore::setNotificationTimestampsForUser(): Allow clearing timestamp"
jenkins-bot [Fri, 16 Dec 2016 20:41:34 +0000 (20:41 +0000)]
Merge "WatchedItemStore::setNotificationTimestampsForUser(): Allow clearing timestamp"

7 years agoMerge "Minor adjustments to align with WikimediaUI color palette"
jenkins-bot [Fri, 16 Dec 2016 20:11:17 +0000 (20:11 +0000)]
Merge "Minor adjustments to align with WikimediaUI color palette"

7 years agoChange linking Special:PageLanguage on action=info
Umherirrender [Fri, 16 Dec 2016 19:57:06 +0000 (20:57 +0100)]
Change linking Special:PageLanguage on action=info

Change from linking of description to extra link behind the data. Also
reorder the code and language name to match the order on
Special:PageLanguage

Change-Id: I859df5d04c5d937fba55c309034a0350574b5af7

7 years agoregistration: Always specify version number in extension.schema.json file
Kunal Mehta [Fri, 16 Dec 2016 19:32:26 +0000 (11:32 -0800)]
registration: Always specify version number in extension.schema.json file

Instead of having the current version of the schema live at
extension.schema.json, always include a version number in it. This
simplifies both the code, and makes merging, cherry-picks, rebasing,
etc. easier when the current schema version changes.

Change-Id: I1b5ef4ced1eb34b8bdda7ba9b3f086b1997b704c

7 years agoWatchedItemStore::setNotificationTimestampsForUser(): Allow clearing timestamp
Brad Jorsch [Fri, 16 Dec 2016 19:31:24 +0000 (14:31 -0500)]
WatchedItemStore::setNotificationTimestampsForUser(): Allow clearing timestamp

ApiSetNotificationTimestamp expects to be able to clear the timestamp by
passing null. Allow that to work as expected.

Bug: T153482
Change-Id: Ibf4ba56f0abd3b72283f7a33e4665d5999a70b82

7 years agoFixing mediawiki's য় problem
Aftab [Wed, 14 Dec 2016 14:20:53 +0000 (14:20 +0000)]
Fixing mediawiki's য় problem

Bengali $magicWords translations with য় (U+09DF) does not working because the character য় (U+09DF) was interpreted by MediaWiki as য (U+09AF) and nukta (U+09BC).

See also: https://gerrit.wikimedia.org/r/#/c/326433/

Bug: T153132
Change-Id: I6ef18acd7c1eb0ce87e81163ef0130620d48d200

7 years agoMerge "TitleWidget: Cache siteinfo API response"
jenkins-bot [Fri, 16 Dec 2016 18:51:54 +0000 (18:51 +0000)]
Merge "TitleWidget: Cache siteinfo API response"

7 years agoTitleWidget: Cache siteinfo API response
Kunal Mehta [Fri, 16 Dec 2016 17:46:38 +0000 (09:46 -0800)]
TitleWidget: Cache siteinfo API response

This information rarely changes, so cache it for a day client-side.

Bug: T153388
Change-Id: I375a17737855eaa661c85e0dde2b7e58b67bc710

7 years agoAdd the concept of "system blocks"
Brad Jorsch [Thu, 1 Dec 2016 16:51:03 +0000 (11:51 -0500)]
Add the concept of "system blocks"

Blocks made for configured proxies, dnsbls, or the configured range
soft-blocks being added in I6c11a6b9 aren't real blocks stored in the
database. Let's actually flag these blocks as such and use a more
appropriate message when displaying them to the user.

Change-Id: I697e3eec2520792e98c193200c2b1c28c35bf382

7 years agoMerge "Decrease the number of 'function says it should return something' errors"
jenkins-bot [Fri, 16 Dec 2016 17:20:16 +0000 (17:20 +0000)]
Merge "Decrease the number of 'function says it should return something' errors"

7 years agoMerge "Fix type annotations"
jenkins-bot [Fri, 16 Dec 2016 17:18:00 +0000 (17:18 +0000)]
Merge "Fix type annotations"

7 years agoMerge "More properly fix error message"
jenkins-bot [Fri, 16 Dec 2016 17:15:12 +0000 (17:15 +0000)]
Merge "More properly fix error message"

7 years agoMore properly fix error message
Brad Jorsch [Fri, 16 Dec 2016 14:34:43 +0000 (09:34 -0500)]
More properly fix error message

I2b686228 was a quick bandaid, but resulted in the error message not
actually reporting the incorrect list type.

Change-Id: I2b2bd6ee66a78fadb31b3524dfe04bf9e1f45535

7 years agoMake the code for grammar data processing common
Amir E. Aharoni [Mon, 28 Sep 2015 10:26:08 +0000 (13:26 +0300)]
Make the code for grammar data processing common

This makes the code for processing JSON files with
grammar transformations reusable by different languages
and applies the same logic to Russian and Hebrew.
It will be done to other languages in further patches.

This patch is not supposed to change any functionality,
and the tests are intact (except a comment in the test
for Hebrew - the class doesn't exist any longer).

PHP:
* Move the JSON grammar transformation data processing logic
  from LanguageRu.php to convertGrammar() in Language.php.
  By default all these data files are supposed to be
  processed identically, so the code should be common.
  If there is no JSON data file, nothing new happens.
* LanguageRu's own convertGrammar() method is removed.
* The LanguageHe class is removed, now that all its functionality
  is handled by generic JSON data processing in the Language class.
  LanguageHe.php file is removed from the repo and from autoloading.

JavaScript:
* Move the JSON grammar transformation data processing logic
  from ru.js to mediawiki.language.js.
* JavaScript grammar code files he.js and ru.js are removed
  from the repo and from Resources.php, because all the data
  is in JSON, and the default logic in mediawiki.language.js
  works for both languages.

Bug: T115217
Change-Id: I5e75467121c3d791bb84f9e6fdfcf07c1840f81a

7 years agoDon't show dialog to confirm whether to reset watchlist
Geoffrey Mon [Fri, 16 Dec 2016 01:35:12 +0000 (20:35 -0500)]
Don't show dialog to confirm whether to reset watchlist

People don't seem to like having a dialog to ask for confirmation to set all
pages to visited in the watchlist, and the PHP server-side reset
functionality doesn't ask for a confirmation anyways.

Bug: T153438
Change-Id: I92aa3c0670925efc691d8bdba2c1c503e17ddb8c

7 years agoMerge "Cleanup some incorrect return annotations"
jenkins-bot [Fri, 16 Dec 2016 07:22:24 +0000 (07:22 +0000)]
Merge "Cleanup some incorrect return annotations"

7 years agoMerge "Add <!DOCTYPE html> to HTML responses"
jenkins-bot [Fri, 16 Dec 2016 07:16:45 +0000 (07:16 +0000)]
Merge "Add <!DOCTYPE html> to HTML responses"

7 years agoMerge "mediawiki.special.watchlist: Optimize JavaScript code"
jenkins-bot [Fri, 16 Dec 2016 07:16:38 +0000 (07:16 +0000)]
Merge "mediawiki.special.watchlist: Optimize JavaScript code"

7 years agoMerge "Add ILocalizedException interface"
jenkins-bot [Fri, 16 Dec 2016 07:15:18 +0000 (07:15 +0000)]
Merge "Add ILocalizedException interface"

7 years agoMerge "IcuCollation: Add the current class name to 'first-letters' cache key"
jenkins-bot [Fri, 16 Dec 2016 07:15:15 +0000 (07:15 +0000)]
Merge "IcuCollation: Add the current class name to 'first-letters' cache key"

7 years agoMerge "Remove un-necessary stdClass use"
jenkins-bot [Fri, 16 Dec 2016 04:14:43 +0000 (04:14 +0000)]
Merge "Remove un-necessary stdClass use"

7 years agoRemove un-necessary stdClass use
Mark A. Hershberger [Fri, 16 Dec 2016 03:36:39 +0000 (22:36 -0500)]
Remove un-necessary stdClass use

And it causes the following warning when you visit the list of special pages:

 The use statement with non-compound name 'stdClass' has no effect

Change-Id: I3698dab32a572e8c39788ddfc0ae2b3312a2e94e

7 years agoFix various minor IDEA warnings in LoadBalancer
Aaron Schulz [Fri, 16 Dec 2016 03:32:26 +0000 (19:32 -0800)]
Fix various minor IDEA warnings in LoadBalancer

Change-Id: Ic65a04ca1b988fe36e088709d7dc4e981670cb62

7 years agoMerge "Add LoadBalancer::getMaintenanceConnectionRef() method"
jenkins-bot [Fri, 16 Dec 2016 03:22:45 +0000 (03:22 +0000)]
Merge "Add LoadBalancer::getMaintenanceConnectionRef() method"

7 years agoAdd NS_TEMPLATE to wgNamespacesWithSubpages in DefaultSettings.php
tjlsangria [Sun, 2 Oct 2016 19:26:42 +0000 (15:26 -0400)]
Add NS_TEMPLATE to wgNamespacesWithSubpages in DefaultSettings.php

Bug: T147160
Change-Id: I504de3332bbc4b39d8d69fa324949988d56d0b67

7 years agoMerge "resourceloader: Include backtrace in formatted errors (if enabled)"
jenkins-bot [Fri, 16 Dec 2016 02:57:57 +0000 (02:57 +0000)]
Merge "resourceloader: Include backtrace in formatted errors (if enabled)"

7 years agoMerge "resourceloader: Don't let module exception break startup"
jenkins-bot [Fri, 16 Dec 2016 02:57:08 +0000 (02:57 +0000)]
Merge "resourceloader: Don't let module exception break startup"

7 years agoresourceloader: Include backtrace in formatted errors (if enabled)
Timo Tijhof [Sat, 3 Dec 2016 03:57:42 +0000 (19:57 -0800)]
resourceloader: Include backtrace in formatted errors (if enabled)

Make ResourceLoader error formatting the same as everywhere else.
Which means if wgShowExceptionDetails is enabled locally, the
trace will be included as well.

This matches logic in MWExceptionRenderer.

Also move the typical error handling used by respond() to a
utility method to reduce duplication of code and avoid mistakes.

Change-Id: If04ae99618e4a758ed0f9dd2b555496b76da29de

7 years agoMerge "registration: Improve dependency checking"
jenkins-bot [Fri, 16 Dec 2016 01:01:39 +0000 (01:01 +0000)]
Merge "registration: Improve dependency checking"

7 years agoMerge "registration: Allow specifying extension dependencies"
jenkins-bot [Fri, 16 Dec 2016 01:00:04 +0000 (01:00 +0000)]
Merge "registration: Allow specifying extension dependencies"

7 years agoMerge "registration: Generalize CoreVersionChecker to VersionChecker"
jenkins-bot [Fri, 16 Dec 2016 00:58:37 +0000 (00:58 +0000)]
Merge "registration: Generalize CoreVersionChecker to VersionChecker"

7 years agoMerge "Fix PhanTypeInvalidLeftOperand in Language.php"
jenkins-bot [Fri, 16 Dec 2016 00:41:58 +0000 (00:41 +0000)]
Merge "Fix PhanTypeInvalidLeftOperand in Language.php"

7 years agoMerge "Fix undefined $param"
jenkins-bot [Fri, 16 Dec 2016 00:20:45 +0000 (00:20 +0000)]
Merge "Fix undefined $param"

7 years agoDecrease the number of 'function says it should return something' errors
Max Semenik [Thu, 15 Dec 2016 23:19:57 +0000 (15:19 -0800)]
Decrease the number of 'function says it should return something' errors

Change-Id: Ib5115fe5bbaa67d8a6e54cc3ba1ba7020e239e11

7 years agoProtect language converter markup in the preprocessor.
C. Scott Ananian [Tue, 20 Sep 2016 22:26:32 +0000 (18:26 -0400)]
Protect language converter markup in the preprocessor.

This ensures that `{{echo|-{R|foo}-}}` is parsed correctly as
a template invocation with a single argument, not as two separate
arguments split by the `|`.

Bug: T146304
Change-Id: I709d007c70a3fd19264790055042c615999b2f67

7 years agoresourceloader: Don't let module exception break startup
Timo Tijhof [Sat, 3 Dec 2016 00:48:14 +0000 (16:48 -0800)]
resourceloader: Don't let module exception break startup

When getScript (or some other method used in a module response)
throws an error, only that module fails (by outputting mw.loader.state
instead of mw.loader.implement). Other modules will work.

This has always been the case and is working fine. For example,
"load.php?modules=foo|bar", where 'foo' throws, will return:

```js
/* exception message: .. */
mw.loader.implement('bar', ..)
mw.loader.state('foo', 'error')
```

The problem, however, is that during the generation of the startup
module, we iterate over all other modules. In 2011, the
getVersionHash method (then: getModifiedTime) was fairly simple
and unlikely to throw errors.

Nowadays, some modules use enableModuleContentVersion which will
involve the same code path as for regular module responses.

The try/catch in ResourceLoader::makeModuleResponse() suffices
for the case of loading modules other than startup. But when
loading the startup module, and an exception happens in getVersionHash,
then the entire startup response is replaced with an exception comment.

Example case:
* A file not existing for a FileModule subclass that uses
  enableModuleContentVersion.
* A database error from a data module, like CiteDataModule or
  CNChoiceData.

Changes:
* Ensure E-Tag is still useful while an error happens in production
  because we respond with 200 OK and one error isn't the same as
  another.
  Fixed by try/catch in getCombinedVersion.
* Ensure start manifest isn't disrupted by one broken module.
  Fixed by try/catch in StartupModule::getModuleRegistrations().

Tests:
* testMakeModuleResponseError: The case that already worked fined.
* testMakeModuleResponseStartupError: The case fixed in this commit.
* testGetCombinedVersion: The case fixed in this commit for E-Tag.

Bug: T152266
Change-Id: Ice4ede5ea594bf3fa591134bc9382bd9c24e2f39

7 years agoregistration: Improve dependency checking
Kunal Mehta [Thu, 15 Dec 2016 23:09:26 +0000 (15:09 -0800)]
registration: Improve dependency checking

* Pass $coreVersion to VersionChecker's constructor, don't require a
setter.
* Bump ExtensionRegistry::CACHE_VERSION
* Return single strings from handle* functions, avoid array_merge calls
* Improve invalid version error message
* Fix naming of VersionCheckerTest class

Change-Id: Id4f66b815aa41dbbc4b966095d6b99e542e548b4