lhc/web/wiklou.git
7 years agoOutputPage: Make use of WrappedStringList in headElement()
Timo Tijhof [Thu, 7 Jul 2016 19:26:36 +0000 (20:26 +0100)]
OutputPage: Make use of WrappedStringList in headElement()

Right now, getInlineHeadScripts(), buildCssLinks() and getExternalHeadScripts()
all return WrappedString::join(). But because they don't know about each other
and because they need to return strings (not arrays), headElement() has no way
of merging them.

WrappedStringList allows this array to be kept, whilst still being backward-compatible
with code that calls these methods and assumig a string (since it will lazy-join
the array if the object is treated like a string).

To be used by I8b6c6a10d965e7396. Output is not changed in this commit.
Merely refactoring.

Change-Id: Iae08345473bd93cc0948d51b62c48aeb1ea460a3

7 years agoMerge "Add any prior block to BlockIpComplete hook"
jenkins-bot [Tue, 12 Jul 2016 18:06:51 +0000 (18:06 +0000)]
Merge "Add any prior block to BlockIpComplete hook"

7 years agoAuthManager: Commit transaction after auto-creating a user
Brad Jorsch [Tue, 12 Jul 2016 17:35:10 +0000 (13:35 -0400)]
AuthManager: Commit transaction after auto-creating a user

As things stand now, DBO_TRX or DBO_DEFAULT will cause a transaction to
be started, and then anything in the entire request failing will
probably cause the newly-added user row to be lost. But updates to
external databases (e.g. CentralAuth) likely won't be since those DB
connections were probably shut down after the update was completed.

So let's explicitly commit changes af the end of auto-creation so that
problems with the request itself don't undo it.

Bug: T119736
Change-Id: I6c13c8feb86d8b9a01df894733c38445d048fea0

7 years agoRename 'slider' gallery mode to 'slideshow'
Ed Sanders [Tue, 12 Jul 2016 13:48:58 +0000 (14:48 +0100)]
Rename 'slider' gallery mode to 'slideshow'

Bug: T140093
Change-Id: I6f01344b9ac61e3d2a8e7a9d920ba37786537ff8

7 years agoSome Balancer improvements for performance and compatibility
Tim Starling [Mon, 4 Jul 2016 05:15:18 +0000 (15:15 +1000)]
Some Balancer improvements for performance and compatibility

* Use a doubly-linked list for the AFE list, instead of an array,
  allowing efficient insertion and removal from the middle, and trivial
  O(1) lookup of existing elements.
* Use a hashtable of singly-linked lists for storing Noah's Ark buckets,
  instead of iterating through the entire AFE list on every push.
* Store attributes in an array instead of serializing them in the
  tokenizer. This allows us to avoid sorting them in the output. For the
  Noah's Ark clause, the array is copied and then sorted on demand.
* XHTML-style serialization with self-closing tags.
* Clear the AFE list in stopParsing(), otherwise all the BalanceElement
  objects are kept alive until after serialization, thus using O(N^2)
  memory (in stack depth N) since the full serialization is stored at
  each stack level.

Change-Id: I517129c0658f03eb2ddee61fdf33ffe6fbd48509

7 years agoHook up Balancer as a Tidy implementation.
C. Scott Ananian [Tue, 14 Jun 2016 21:59:20 +0000 (17:59 -0400)]
Hook up Balancer as a Tidy implementation.

This is an HTML5-compliant parse/serialize tidy implementation, with
well-delineated hacks to support the <p>-wrapping done by legacy tidy.

Change-Id: I4fd433fd6f1847061b0bf4b3e249c918720d4fae

7 years agoHTML5 Balancer
C. Scott Ananian [Tue, 15 Mar 2016 19:13:43 +0000 (15:13 -0400)]
HTML5 Balancer

This adds an implementation of the HTML5 Tree Builder algorithm to PHP,
along with test cases from the tree builder derived from the
html5lib-tests package on github.  The test cases were preprocessed
into JSON for the `domino` HTML5 parser, and we're using the JSON
form of the tests.

The implementation follows both the language of the HTML5 specification
and the implementation in `domino` very closely, easing updates if the
specification changes.

This code is used in follow-on commits to support an HTML5-based
"tidy" for mediawiki and the `{{#balance}}` parser function, which
ensures that a template expands to properly-balanced HTML, with all
tags closed and nothing left on the HTML active formatting elements
list.

See: https://github.com/fgnass/domino
Change-Id: I6f4d20a43510dd819776bb333b639315b19d150d

7 years agoAdd tracking category when editors use the deprecated self-closed tag hack.
C. Scott Ananian [Wed, 4 May 2016 18:01:00 +0000 (14:01 -0400)]
Add tracking category when editors use the deprecated self-closed tag hack.

Some pages use constructs like `<b/>` or `<span/>` to protect spaces or
special characters at the beginning/end of templates.  This syntax is
incompatible with HTML5 parsing rules, which dictate that these should
be treated as open tags, and instead rely on an unusual quirk of the
`tidy` program that removes invalid constructs.

This syntax is deprecated as part of the process of reconciling `tidy`
with modern HTML5 parsing semantics.  Authors can use `&#32;` or `<nowiki/>`
as valid replacements.

In order to provide time to transition existing content, pages using
self-closing tags in violation of the HTML5 parsing specification
will have their templates/pages added to a new tracking category.
After these uses are fixed, we will change the sanitizer to treat these
as normal open tags, to be consistent with the HTML5 parsing spec.

Note that this construct is already disallowed if tidy is disabled; it
is rendered as `&lt;b/>`.  We add a tracking category in the no-tidy
case as well, in preparation for eventually making the no-tidy and
with-tidy behaviors consistent.

Bug: T134423
Change-Id: Ie1cf3aa40d5483bf395ece539f0240b694ff04ab

7 years agoMerge "Improve comments on fields and fix opening_text - needs no highlights."
jenkins-bot [Tue, 12 Jul 2016 00:40:58 +0000 (00:40 +0000)]
Merge "Improve comments on fields and fix opening_text - needs no highlights."

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 11 Jul 2016 20:03:45 +0000 (22:03 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ic1d591a09a31a027c0799e6833a302bb4de9477e

7 years agoMerge "mw.Upload.BookletLayout: Better handle error messages from AbuseFilter and...
jenkins-bot [Mon, 11 Jul 2016 19:38:51 +0000 (19:38 +0000)]
Merge "mw.Upload.BookletLayout: Better handle error messages from AbuseFilter and TitleBlacklist"

7 years agoMerge "ApiUpload: Better handle ApiMessage errors from UploadVerifyFile hook"
jenkins-bot [Mon, 11 Jul 2016 19:34:49 +0000 (19:34 +0000)]
Merge "ApiUpload: Better handle ApiMessage errors from UploadVerifyFile hook"

7 years agoMerge "Move span.comment back to shared.css as its more widely used"
jenkins-bot [Mon, 11 Jul 2016 16:25:33 +0000 (16:25 +0000)]
Merge "Move span.comment back to shared.css as its more widely used"

7 years agoMove span.comment back to shared.css as its more widely used
Prateek Saxena [Sun, 10 Jul 2016 05:08:30 +0000 (10:38 +0530)]
Move span.comment back to shared.css as its more widely used

...than the other changeslist CSS classes. This commit partially
reverts 9e458504c7b4.

Bug: T139722
Bug: T139832
Bug: T139833
Bug: T139835
Bug: T139836
Bug: T139837
Bug: T139838
Bug: T139839
Bug: T139840
Bug: T139841
Change-Id: Ia4a7b6d0d19f0f62cd2402cd81f944ab31fb84c0

7 years agoMerge "build: Bump grunt-karma and related tools to 1.0.x"
jenkins-bot [Mon, 11 Jul 2016 16:03:20 +0000 (16:03 +0000)]
Merge "build: Bump grunt-karma and related tools to 1.0.x"

7 years agoUpdate documentation for I30e359fb
Brad Jorsch [Mon, 11 Jul 2016 15:16:18 +0000 (11:16 -0400)]
Update documentation for I30e359fb

Change-Id: I3a13c02ecaf76ac9affcae1a895a6194466c7658

7 years agobuild: Bump grunt-karma and related tools to 1.0.x
Paladox [Tue, 28 Jun 2016 17:12:45 +0000 (18:12 +0100)]
build: Bump grunt-karma and related tools to 1.0.x

Also bump karma to 1.1.0 see changelog at
https://github.com/karma-runner/karma/releases please

Change-Id: Ic982dfc7ccebeecd6082b5476372cbb87fec5f1b

7 years agoMerge "Make classes actually work in lines in EnhancedChangesList"
jenkins-bot [Mon, 11 Jul 2016 07:59:02 +0000 (07:59 +0000)]
Merge "Make classes actually work in lines in EnhancedChangesList"

7 years agoMerge "API: Allow anonymous CORS from anywhere, when specifically requested"
jenkins-bot [Mon, 11 Jul 2016 00:58:37 +0000 (00:58 +0000)]
Merge "API: Allow anonymous CORS from anywhere, when specifically requested"

7 years agoMerge "ApiQuery: Don't mess with PHP output buffering"
jenkins-bot [Sun, 10 Jul 2016 23:28:21 +0000 (23:28 +0000)]
Merge "ApiQuery: Don't mess with PHP output buffering"

7 years agoMerge "Use READ_LATEST for the WikiPage in RefreshLinksJob"
jenkins-bot [Sun, 10 Jul 2016 23:22:24 +0000 (23:22 +0000)]
Merge "Use READ_LATEST for the WikiPage in RefreshLinksJob"

7 years agoMerge "Fix grammar in transaction-duration-limit-exceeded"
jenkins-bot [Sun, 10 Jul 2016 23:19:43 +0000 (23:19 +0000)]
Merge "Fix grammar in transaction-duration-limit-exceeded"

7 years agoMerge "Use more short array syntax in comments (/tests/)"
jenkins-bot [Sun, 10 Jul 2016 23:15:14 +0000 (23:15 +0000)]
Merge "Use more short array syntax in comments (/tests/)"

7 years agoMerge "Parse sidebar message for main page when cache is enabled"
jenkins-bot [Sun, 10 Jul 2016 23:12:39 +0000 (23:12 +0000)]
Merge "Parse sidebar message for main page when cache is enabled"

7 years agoMerge "Revert "If rev_content_model is null, use page_content_model.""
jenkins-bot [Sun, 10 Jul 2016 23:07:40 +0000 (23:07 +0000)]
Merge "Revert "If rev_content_model is null, use page_content_model.""

7 years agoRevert "If rev_content_model is null, use page_content_model."
Legoktm [Sun, 10 Jul 2016 22:58:36 +0000 (22:58 +0000)]
Revert "If rev_content_model is null, use page_content_model."

This patch effectively reverted a5bc9f49cd01e49c, which
was the correct behavior. If a page were to have its content
model changed, the NULL revision rows would now be interpreted
as the page's new content model instead of the default content
model (which they should be).

This reverts commit 9a6ff0bd82faafbf9746a6fa3ed33f42092587c3.

Change-Id: I6801d09bd847f477222e503b912005b02a9df045

7 years agoMerge "Remove old WebResponse::setCookie() calling method"
jenkins-bot [Sun, 10 Jul 2016 21:42:29 +0000 (21:42 +0000)]
Merge "Remove old WebResponse::setCookie() calling method"

7 years agocomposer/semver 1.4.0 -> 1.4.1
Reedy [Sun, 10 Jul 2016 20:44:18 +0000 (21:44 +0100)]
composer/semver 1.4.0 -> 1.4.1

https://github.com/composer/semver/compare/1.4.0...1.4.1

Depends-On: I29afc0187f0fe0e920c27710ff06ff1d502896e6
Change-Id: Idd09dcee04c5781946079bcec087d15186fb1bea

7 years agoParse sidebar message for main page when cache is enabled
umherirrender [Sun, 10 Jul 2016 20:17:27 +0000 (22:17 +0200)]
Parse sidebar message for main page when cache is enabled

When the sidebar cache is enabled, parse the messages for the links and
link text of the sidebar with the main page as title, because variable
like FULLPAGENAME would vary on page, but cache does not.

Change-Id: I0bbb05f1abe4be1a61f520d647c8ca696d184ccf

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 10 Jul 2016 19:54:23 +0000 (21:54 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I5b1be9bfed1741466b7364c6314f8cfe86c27128

7 years agoUse more short array syntax in comments (/tests/)
umherirrender [Sun, 10 Jul 2016 15:23:29 +0000 (17:23 +0200)]
Use more short array syntax in comments (/tests/)

Change-Id: I86c73cb9447ac562a73348b4030e24ebf49a90dc

7 years agoFix grammar in transaction-duration-limit-exceeded
Aaron Schulz [Sun, 10 Jul 2016 14:36:31 +0000 (07:36 -0700)]
Fix grammar in transaction-duration-limit-exceeded

Change-Id: I5e9db36abdb4c498c97640790490508452fdefd3

7 years agoUse READ_LATEST for the WikiPage in RefreshLinksJob
Aaron Schulz [Sun, 10 Jul 2016 11:14:12 +0000 (04:14 -0700)]
Use READ_LATEST for the WikiPage in RefreshLinksJob

Also sanity check that the revision belongs to that page.

Change-Id: I4e6897b52212d9787d74fb017861ec62f2927f0e

7 years agoMerge "Add missing colons"
jenkins-bot [Sat, 9 Jul 2016 21:18:53 +0000 (21:18 +0000)]
Merge "Add missing colons"

7 years agoAdd missing colons
matejsuchanek [Sat, 9 Jul 2016 19:58:36 +0000 (21:58 +0200)]
Add missing colons

Consistent with other log-action-filter-(action) messages.

Bug: T132889
Change-Id: I6b5e98aedd7bec37280684b362ccf936e45f6a30

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 9 Jul 2016 19:57:10 +0000 (21:57 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I655debf814eca6ac00daaca122ed838da8c45a9b

7 years agoHandle the default value of $wgExternalDiffEngine without warning
Seb35 [Sat, 9 Jul 2016 08:07:49 +0000 (10:07 +0200)]
Handle the default value of $wgExternalDiffEngine without warning

The default value (false) was not handled by the recent depreciation warnings
in 037f056, and was triggering the last warning. This removes this warning.

Change-Id: If7fe92d874eb10525a72f6d3a97f00117c79acc1

7 years agoRun generateLocalAutoload.php
Kevin Israel [Fri, 8 Jul 2016 22:52:20 +0000 (18:52 -0400)]
Run generateLocalAutoload.php

Follows-up ae0bae92afe0307d.

Change-Id: I5f7decd6a5279e941a7e1406dca77bbe37a1f3cb

7 years agoApiQuery: Don't mess with PHP output buffering
Kevin Israel [Fri, 8 Jul 2016 20:22:27 +0000 (16:22 -0400)]
ApiQuery: Don't mess with PHP output buffering

Specifically, it is not necessary to use output buffering functions
to capture XML generated by the export code because it is already
possible to set the "output sink" object to be used.

* Created a DumpStringOutput class, which appends all output to a
  string property rather than printing output immediately.
* Used that class, instead of ob_start() and ob_get_clean(), in
  ApiQuery and ExportTest.

Change-Id: I238f5d5ec7fd442c845b25cb59ef81ac3285099f

7 years agoIf rev_content_model is null, use page_content_model.
daniel [Thu, 7 Jul 2016 13:06:12 +0000 (15:06 +0200)]
If rev_content_model is null, use page_content_model.

We currently leave rev_content_model = null  if it'S the default, to save space.
When loading a revision, we so far fell back to the per-namespace default content
model if rev_content_model was null, even if page_content_model was null.

This patch changes the fallback from rev_contentModel -> namespace-default-model
to rev_content_model -> page_content_model -> namespace-default-model.

This will prevent errors triggered when chaing a namespace'sdefault content model:
so far, revisions with the old content model would fail to deserialize becaue,
because they were being interpreted according to the changed namespace defrault,
instead of the correct model in page_content_model.

Bug: T128466
Change-Id: I75c60eb129428b0b433480443ab9153cc58cda8f

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 8 Jul 2016 20:33:15 +0000 (22:33 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I7c5e1326e76de65612653cb8e8167c7d062fa7c2

7 years agoImprove comments on fields and fix opening_text - needs no highlights.
Stanislav Malyshev [Fri, 8 Jul 2016 18:52:55 +0000 (11:52 -0700)]
Improve comments on fields and fix opening_text - needs no highlights.

Change-Id: Iad6876aae109ad84c5534619f47c72edc900d704

7 years agoMerge "Clarify functionality of 'captionLength' in GalleryOptions"
jenkins-bot [Fri, 8 Jul 2016 19:06:06 +0000 (19:06 +0000)]
Merge "Clarify functionality of 'captionLength' in GalleryOptions"

7 years agoTitleWidget: Add missing return documentation
Ed Sanders [Fri, 8 Jul 2016 17:33:25 +0000 (18:33 +0100)]
TitleWidget: Add missing return documentation

Change-Id: Iea34d7e5dd4c54a13ac559bb2685246e0f096227

7 years agoClarify functionality of 'captionLength' in GalleryOptions
Ed Sanders [Fri, 8 Jul 2016 16:23:43 +0000 (17:23 +0100)]
Clarify functionality of 'captionLength' in GalleryOptions

Change-Id: Ieaacec06282785d789ed89acc984b4dff4ad4460

7 years agoMake classes actually work in lines in EnhancedChangesList
amir [Fri, 8 Jul 2016 09:36:09 +0000 (09:36 +0000)]
Make classes actually work in lines in EnhancedChangesList

Change-Id: I2a1dc712d735077dd3741aa0d066933a81c4e568

7 years agoNew parserTests.php features
Tim Starling [Wed, 9 Mar 2016 04:42:33 +0000 (15:42 +1100)]
New parserTests.php features

Features to support T89331 analysis:

* Support dwdiff for word-level diffing
* Add --mark-ws feature which produces cleaner diffs when line breaks
  differ
* Add optional normalization of parser test output, allowing significant
  differences to be separated from insignificant differences.

Change-Id: I0e151caad1f8b2f97bf20b219f26f3101be82506

7 years agoMerge "API: Generate head items in the context of the given title"
jenkins-bot [Thu, 7 Jul 2016 22:47:22 +0000 (22:47 +0000)]
Merge "API: Generate head items in the context of the given title"

7 years agoUpdate wikimedia/wrappedstring to v2.1.1
Timo Tijhof [Thu, 7 Jul 2016 18:45:08 +0000 (19:45 +0100)]
Update wikimedia/wrappedstring to v2.1.1

New method to be used in OutputPage.

Depends-On: I18c93dbb29c61c515de74b02d04aea077aadeb52
Change-Id: I70ab1b57cef5b988e215c7c4365b92f7eb9c5693

7 years agoMerge "Localisation updates from https://translatewiki.net."
Translation updater bot [Thu, 7 Jul 2016 20:07:09 +0000 (20:07 +0000)]
Merge "Localisation updates from https://translatewiki.net."

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 7 Jul 2016 19:54:54 +0000 (21:54 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Idc43190454d0d375d7537815a400438c21101171

7 years agoPermit use of User::getDefaultOptions() in-process cache in unit tests
Ori Livneh [Mon, 9 May 2016 07:15:13 +0000 (00:15 -0700)]
Permit use of User::getDefaultOptions() in-process cache in unit tests

MediaWiki uses an in-process cache to speed up repeat calls to
User::getDefaultOptions() -- except when the unit tests are running, in which
case the process cache is disabled, because otherwise it would be at risk of
becoming stale due to unit tests manipulating $wgContLang. Well, there's a less
aggressive option, which is to keep the cache enabled but use it only if
$wgContLang hasn't changed. Since MediaWiki's test setup code creates default
users for the unit tests, User::getDefaultOptions() ends up getting called
quite a lot, so enabling the process cache is worth the trouble.

Change-Id: I81f3ae42d356939c81e59ab12d7a9e7d1206cb40

7 years agoMerge "Create API to allow content handlers to handle structured data definitions"
jenkins-bot [Thu, 7 Jul 2016 16:56:09 +0000 (16:56 +0000)]
Merge "Create API to allow content handlers to handle structured data definitions"

7 years agoMerge "Add missing …|null $context documentation to Action class"
jenkins-bot [Thu, 7 Jul 2016 16:44:09 +0000 (16:44 +0000)]
Merge "Add missing …|null $context documentation to Action class"

7 years agoGallery: Add new slider mode
Prateek Saxena [Wed, 4 May 2016 16:13:55 +0000 (21:43 +0530)]
Gallery: Add new slider mode

Bug: T128429
Change-Id: I14cac38cf1c66d9ba9584772a1cd3f345731b2af

7 years agoAPI: Generate head items in the context of the given title
Brad Jorsch [Thu, 7 Jul 2016 13:40:57 +0000 (09:40 -0400)]
API: Generate head items in the context of the given title

$context->getOutput() returns an OutputPage tied to the main
RequestContext at the root of the chain, not to the modified context
we're actually using.

Bug: T139565
Change-Id: Ie086d7f2ad3f7b5f50e3a2f83b1680e760b85e5e

7 years agoMerge "Modified Lojban interwiki"
jenkins-bot [Thu, 7 Jul 2016 07:05:18 +0000 (07:05 +0000)]
Merge "Modified Lojban interwiki"

7 years agoRelease notes for UploadVerifyUpload hook (8f2acfcd)
Bartosz Dziewoński [Thu, 7 Jul 2016 06:25:44 +0000 (08:25 +0200)]
Release notes for UploadVerifyUpload hook (8f2acfcd)

Change-Id: Ic8c79e7c56c747795b59a05c2cae1e5ca59e417f

7 years agoPass addModuleStyles an array instead of calling it multiple times
Prateek Saxena [Thu, 7 Jul 2016 05:22:14 +0000 (10:52 +0530)]
Pass addModuleStyles an array instead of calling it multiple times

Change-Id: Ia359c441714c039c505acd4bd37dd1b52c60b8ea

7 years agoMerge "Introduce new hook UploadVerifyUpload to allow preventing file uploads"
jenkins-bot [Thu, 7 Jul 2016 02:27:44 +0000 (02:27 +0000)]
Merge "Introduce new hook UploadVerifyUpload to allow preventing file uploads"

7 years agoMerge "mediawiki.api: Don't abort token requests in postWithToken()"
jenkins-bot [Thu, 7 Jul 2016 00:10:13 +0000 (00:10 +0000)]
Merge "mediawiki.api: Don't abort token requests in postWithToken()"

7 years agoMerge "Revert "Adding a bunch of hooks from wikiHow into DifferenceEngine""
jenkins-bot [Wed, 6 Jul 2016 21:57:33 +0000 (21:57 +0000)]
Merge "Revert "Adding a bunch of hooks from wikiHow into DifferenceEngine""

7 years agoMerge "Revert "Show parser output for diffs unless extension aborts""
jenkins-bot [Wed, 6 Jul 2016 21:49:13 +0000 (21:49 +0000)]
Merge "Revert "Show parser output for diffs unless extension aborts""

7 years agoRevert "Adding a bunch of hooks from wikiHow into DifferenceEngine"
MaxSem [Wed, 6 Jul 2016 21:28:42 +0000 (21:28 +0000)]
Revert "Adding a bunch of hooks from wikiHow into DifferenceEngine"

Causes fatals.

This reverts commit b02bfac06b04fd0284faa785f932792ce9bb93ae.

Bug: T139526
Change-Id: I4c77b4d51408540a9238d38e8324028879b1bbf2

7 years agoMerge "Log the session cache type along with other cache types"
jenkins-bot [Wed, 6 Jul 2016 21:41:24 +0000 (21:41 +0000)]
Merge "Log the session cache type along with other cache types"

7 years agoRevert "Show parser output for diffs unless extension aborts"
MaxSem [Wed, 6 Jul 2016 21:30:13 +0000 (21:30 +0000)]
Revert "Show parser output for diffs unless extension aborts"

Reverting the underlying change.

This reverts commit 3354e8d550e6d650a0b1681fcad427559aea25ce.

Bug: T139526
Change-Id: I2e0f2098981bda411f360eea89e5fac3b644f043

7 years agoLog the session cache type along with other cache types
Brad Jorsch [Wed, 6 Jul 2016 21:19:25 +0000 (17:19 -0400)]
Log the session cache type along with other cache types

We already log the types of the main, WAN, stash, message, and parser
caches. For debugging, it would be useful to log the session cache too
instead of having to guess that it's probably the same as the main
cache.

Change-Id: I13e6c0f7f430f96be50d543a32c232f0c36dcd72

7 years agoMerge "DifferenceEngine: Autodetect if wikidiff2 is installed"
jenkins-bot [Wed, 6 Jul 2016 21:17:40 +0000 (21:17 +0000)]
Merge "DifferenceEngine: Autodetect if wikidiff2 is installed"

7 years agoCreate API to allow content handlers to handle structured data definitions
Stanislav Malyshev [Fri, 13 May 2016 00:10:52 +0000 (17:10 -0700)]
Create API to allow content handlers to handle structured data definitions

Change-Id: Ia1738803c42f6114575587c1c838fec62b6f54aa
Bug: T89733

7 years agoMerge "Add mediawiki.special.changeslist to SpecialContributions"
jenkins-bot [Wed, 6 Jul 2016 20:25:09 +0000 (20:25 +0000)]
Merge "Add mediawiki.special.changeslist to SpecialContributions"

7 years agoMerge "Add new mw-contributions-current css class to Special:Contributions"
jenkins-bot [Wed, 6 Jul 2016 20:14:53 +0000 (20:14 +0000)]
Merge "Add new mw-contributions-current css class to Special:Contributions"

7 years agoAdd mediawiki.special.changeslist to SpecialContributions
Bryan Davis [Wed, 6 Jul 2016 20:13:04 +0000 (14:13 -0600)]
Add mediawiki.special.changeslist to SpecialContributions

Bug: T139522
Change-Id: I7f93ec63b2e540c2f4cce4fe61b855207c156747

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 6 Jul 2016 19:54:08 +0000 (21:54 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ica0223dd72c8d76268f4355e1c66a9091cfdf7a4

7 years agoCreate BagOStuff implementation to talk to RestBase
Stanislav Malyshev [Thu, 9 Jun 2016 19:38:05 +0000 (12:38 -0700)]
Create BagOStuff implementation to talk to RestBase

Or any other HTTP REST server.

Bug: T137272
Change-Id: Iefef24ffa831ba59d7725da8d20d5addb544b3ab

7 years agoMerge "Move diff CSS from mediawiki.legacy.shared"
jenkins-bot [Wed, 6 Jul 2016 17:15:41 +0000 (17:15 +0000)]
Merge "Move diff CSS from mediawiki.legacy.shared"

7 years agoAdd $visibilityChangeMap parameter to RevDelList doPostCommitUpdates
Andrew Otto [Fri, 10 Jun 2016 20:07:34 +0000 (16:07 -0400)]
Add $visibilityChangeMap parameter to RevDelList doPostCommitUpdates

This paramater contains a map of id => old and new visibility bits.
This allows doPostCommitUpdates to do something useful with the
differences before and after a visibility change.  Specifically,
RevDelRevisionList doPostCommitUpdates passes this to the
ArticleRevisionVisibilitySet hook.

Bug: T137287
Change-Id: I1824f56d2aadc15671c442cf30dc1f9f01e821f8

7 years agoRefactor database-related code in ApiQueryWatchlistRaw
Leszek Manicki [Fri, 17 Jun 2016 11:11:05 +0000 (13:11 +0200)]
Refactor database-related code in ApiQueryWatchlistRaw

Database queries used to get user's watchlist items in API are quite
complex due to number of options oferred by the API.
Generating the query is moved to WatchedItemQueryService.
ApiQueryWatchlistRaw no longer contains database-related code.

Simple user watchlist item lookups should use WatchedItemStore.

ApiQueryWatchlistRaw tests have been introduced in
I9c07aa237607143985f0efe20ed0065d2bde27e4

Bug: T132566
Change-Id: I875a92074b52c00ac11db1fa05615abbf5262ab1

7 years agoMerge "registration: Remove broken ResourceLoaderLESSImportPaths support"
jenkins-bot [Wed, 6 Jul 2016 02:23:46 +0000 (02:23 +0000)]
Merge "registration: Remove broken ResourceLoaderLESSImportPaths support"

7 years agomediawiki.api: Don't abort token requests in postWithToken()
Matt Russell [Thu, 30 Jun 2016 06:57:24 +0000 (16:57 +1000)]
mediawiki.api: Don't abort token requests in postWithToken()

Per Ie05d267f1.

Other requests can still make use of the token, even if this one won't, so
only abort the actual request if it is currently running, otherwise abort it
as soon as the token request finishes.

The only caveat with this method is an abort while a token request is running
isn't instantaneous, which perhaps isn't expected, but I doubt it matters.

Change-Id: Ib34e2e3a7f8ca5eb0832c4a6c1623a638381e6c8

7 years agoShow parser output for diffs unless extension aborts
Matthew Flaschen [Wed, 6 Jul 2016 00:08:32 +0000 (20:08 -0400)]
Show parser output for diffs unless extension aborts

It was backwards.

Bug: T139433
Change-Id: Ie370da9d77e1d7608e2d5492f9d34094af233d0b

7 years agoMerge "Revert "Convert Special:MergeHistory to use OOUI.""
jenkins-bot [Tue, 5 Jul 2016 23:42:34 +0000 (23:42 +0000)]
Merge "Revert "Convert Special:MergeHistory to use OOUI.""

7 years agoresourceloader: Replace SHA1 with 32-bit FNV-1 as hash function
Ori Livneh [Wed, 22 Jun 2016 22:32:58 +0000 (15:32 -0700)]
resourceloader: Replace SHA1 with 32-bit FNV-1 as hash function

SHA-1 is not secure enough to be used as a cryptographic hash function, and its
implementation in JavaScript is too long and too slow for it to be a good
general-purpose hash function. And we currently throw away most of the work:
SHA-1 produces 160-bit hash values, of which we keep 48.

Although the JavaScript implementation is not exported, SHA-1 is a well-known
hash function, and I'm willing to bet that sooner or later someone will move to
make it accessible to other modules, at which point usage will start to spread.

For ResourceLoader, the qualities we're looking for in a hash function are:

* Already implemented in PHP
* Easy to implement in JavaScript
* Fast
* Collision-resistant

The requirement that hashes be cheap to compute in JavaScript narrows the field
to 32-bit hash functions, because in JavaScript bitwise operators treat their
operands as 32 bits, and arithmetic uses double-precision floats, which have a
total precision of 53 bits. It's possible to work around these limitations, but
it's a lot of extra work.

The best match I found is the 32-bit variant of FNV-1, which is available in
PHP as of version 5.4 (as 'fnv1a32'). The fnv132 JavaScript function is
around ten times faster and eight times shorter than sha1.

Change-Id: I1e4fb08d17948538d96f241b2464d594fdc14578

7 years agoMerge "Fixes to LocalFile::lock()"
jenkins-bot [Tue, 5 Jul 2016 20:08:53 +0000 (20:08 +0000)]
Merge "Fixes to LocalFile::lock()"

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 5 Jul 2016 19:56:28 +0000 (21:56 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ia097accd2d28baec1f7932cdb30299e0dc1a7781

7 years agoAdd new mw-contributions-current css class to Special:Contributions
Florian [Thu, 24 Mar 2016 17:17:17 +0000 (18:17 +0100)]
Add new mw-contributions-current css class to Special:Contributions

If the current revision of a page, where a user contributed to, is the
revision of this user ("current"), add the new css class
mw-contributions-current to the li-element to allow styling the whole
line differently.

Bug: T130824
Change-Id: I556b374585523a7c51278c2dc83bb03fd3b0ee33

7 years agoTitleOptionWidget: don't subvert OptionWidget's tabindex
David Lynch [Tue, 5 Jul 2016 16:24:04 +0000 (11:24 -0500)]
TitleOptionWidget: don't subvert OptionWidget's tabindex

OptionWidget takes steps to not interfere in the tab order. TitleOptionWidget
uses links as its labels, which has a side-effect of reintroducing a tab-
focusable element into the OptionWidget. Explicitly set tabindex="-1" on these
links, to maintain the OptionWidget behavior.

Bug: T129792
Change-Id: Ia6b1361e7183e253b7abc58037f007936dfa60ff

7 years agoRemove unused imports
Thiemo Mättig [Tue, 5 Jul 2016 14:52:22 +0000 (16:52 +0200)]
Remove unused imports

Change-Id: I3b2ede8a11863c0fb775d851abb251e44ad616db

7 years agoAdd missing …|null $context documentation to Action class
Thiemo Mättig [Tue, 5 Jul 2016 14:49:17 +0000 (16:49 +0200)]
Add missing …|null $context documentation to Action class

Change-Id: If365123ffafe8c3eb7566432276131f815a68280

7 years agoMove diff CSS from mediawiki.legacy.shared
Prateek Saxena [Tue, 5 Jul 2016 13:06:27 +0000 (18:36 +0530)]
Move diff CSS from mediawiki.legacy.shared

...to mediawiki.action.history.diff.

Bug: T89981
Change-Id: I95c93286e5e6c9c177f17ed8dd0fa44c132b35bb

7 years agoRevert "Convert Special:MergeHistory to use OOUI."
Bartosz Dziewoński [Tue, 5 Jul 2016 09:59:01 +0000 (11:59 +0200)]
Revert "Convert Special:MergeHistory to use OOUI."

The new form doesn't check the CSRF token. We should use either just
HTMLForm (which checks the token automatically) or just FormOptions
(and check it ourselves), not a mix of the two.

This reverts commit 598068334e72be83088b9acdf674a79293f040ba.
This reverts commit 475e78c377f81a8837462852cdaab05e01cd686c.

Bug: T138346
Change-Id: Icc100552f3fba2e5e17ae6a2f57c2bfed32fbe83

7 years agoMerge "Update the way captions show up in packed-overlay and packed-hover"
jenkins-bot [Tue, 5 Jul 2016 09:44:14 +0000 (09:44 +0000)]
Merge "Update the way captions show up in packed-overlay and packed-hover"

7 years agoFixes to LocalFile::lock()
Aaron Schulz [Mon, 4 Jul 2016 18:02:42 +0000 (11:02 -0700)]
Fixes to LocalFile::lock()

* Added onTransactionResolution() DB method.
* Use this method so that file unlocks fire on unlockAndRollback()
  as well as on DB errors (via MWExceptionHandler::handleException).
  This prevents locks from getting stuck for minutes when deadlocks
  happen, since the LockManager::destruct() method is not reliable.
* Fix broken reference counting which always released locks on the
  first unlock() call, even if there were 2+ lock() calls.
* Added some type hints to IDatabase methods.
* Fixed DatabaseBase::__destruct() logging to include all callbacks.

Bug: T132921
Change-Id: I684706957f4d794cb6fe61505b0d26b7893de706

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 4 Jul 2016 19:57:01 +0000 (21:57 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I46a80dc4344a68d51e8e20e330d95231ce004beb

7 years agoMerge "Follow-up 6af8dcf: Remove duplicate styles in shared.css"
jenkins-bot [Mon, 4 Jul 2016 19:07:03 +0000 (19:07 +0000)]
Merge "Follow-up 6af8dcf: Remove duplicate styles in shared.css"

7 years agoFix comment typos in mediawiki.js
aude [Mon, 4 Jul 2016 12:10:50 +0000 (14:10 +0200)]
Fix comment typos in mediawiki.js

Change-Id: I40f90913f62f611f1bd940130751355f34dac5bf

7 years agoMerge "registration: Add schema validation ResourceLoaderWikiModule"
jenkins-bot [Mon, 4 Jul 2016 06:53:05 +0000 (06:53 +0000)]
Merge "registration: Add schema validation ResourceLoaderWikiModule"

7 years agoFollow-up 6af8dcf: Remove duplicate styles in shared.css
Prateek Saxena [Mon, 4 Jul 2016 05:59:31 +0000 (11:29 +0530)]
Follow-up 6af8dcf: Remove duplicate styles in shared.css

Bug: T138721
Change-Id: I1733fcf1b3155b43dee8b79036f91b8d6cc25d05

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 3 Jul 2016 19:53:33 +0000 (21:53 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ic18771748bb4ac83b3d7810a1cb123345da8c452

7 years agoDifferenceEngine: Autodetect if wikidiff2 is installed
Kunal Mehta [Sat, 2 Jul 2016 00:01:09 +0000 (17:01 -0700)]
DifferenceEngine: Autodetect if wikidiff2 is installed

If wikidiff2 is installed, use it for diffing without requiring
$wgExternalDiffEngine to be set to 'wikidiff2'.

Also add some extra sanity-checking by coercing all non-string values to
false and make sure the custom diff executable passes `is_executable()`.

Change-Id: I32b670ebf613be9f1c034d65d006829a215614da

7 years agoMerge "API: Log non-whitelisted CORS requests with session cookies"
jenkins-bot [Sat, 2 Jul 2016 22:07:28 +0000 (22:07 +0000)]
Merge "API: Log non-whitelisted CORS requests with session cookies"