lhc/web/wiklou.git
7 years agoUpdate and broaden @covers for PreprocessorTest
Tim Starling [Fri, 26 Aug 2016 01:01:07 +0000 (11:01 +1000)]
Update and broaden @covers for PreprocessorTest

This class is intended to be an integration test of both preprocessor
implementations and their helper classes.

Change-Id: Iefbd6d8828bbc3278503a0f85efd7d1230a9d66c

7 years agoMerge "LoginSignupSpecialPage: Restore old display of 'createacct-helpusername'"
jenkins-bot [Thu, 25 Aug 2016 23:33:45 +0000 (23:33 +0000)]
Merge "LoginSignupSpecialPage: Restore old display of 'createacct-helpusername'"

7 years agoMerge "Add urls from various adware to the CSP false positive list"
jenkins-bot [Thu, 25 Aug 2016 23:01:49 +0000 (23:01 +0000)]
Merge "Add urls from various adware to the CSP false positive list"

7 years agoAdd urls from various adware to the CSP false positive list
Brian Wolff [Thu, 25 Aug 2016 20:32:55 +0000 (20:32 +0000)]
Add urls from various adware to the CSP false positive list

URLs are based on spam that comes into the Wikimedia log files,
based on testing on elwiki.

Change-Id: Iee86633abaae86c55764365042681bda1f2304be

7 years agoLoginSignupSpecialPage: Restore old display of 'createacct-helpusername'
Bartosz Dziewoński [Thu, 25 Aug 2016 20:23:17 +0000 (22:23 +0200)]
LoginSignupSpecialPage: Restore old display of 'createacct-helpusername'

Note that this message is empty by default. You'll have to create it
on your wiki to see effects of this change.

Bug: T143923
Change-Id: I509c13775426b8d51f65c95af49dffb84ccaa0f4

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

Change-Id: Ia68c69742fbb7eae69e4160e923ec7fa459f7b67

7 years agoMerge "Linker: Avoid Title in normaliseSpecialPage()"
jenkins-bot [Thu, 25 Aug 2016 19:26:30 +0000 (19:26 +0000)]
Merge "Linker: Avoid Title in normaliseSpecialPage()"

7 years agoMerge "debug: Interpolate log messages"
jenkins-bot [Thu, 25 Aug 2016 19:24:11 +0000 (19:24 +0000)]
Merge "debug: Interpolate log messages"

7 years agoMerge "debug: Merge mediawiki.debug.init module into mediawiki.debug"
jenkins-bot [Thu, 25 Aug 2016 19:17:55 +0000 (19:17 +0000)]
Merge "debug: Merge mediawiki.debug.init module into mediawiki.debug"

7 years agoMerge "debug: Don't show git branch if on a detached HEAD"
jenkins-bot [Thu, 25 Aug 2016 19:16:54 +0000 (19:16 +0000)]
Merge "debug: Don't show git branch if on a detached HEAD"

7 years agomediawiki.inspect: Output size in bytes used in local storage
Peter Hedenskog [Thu, 25 Aug 2016 18:36:25 +0000 (20:36 +0200)]
mediawiki.inspect: Output size in bytes used in local storage

The current version only outputs the total size formated
human readable (kb, mb etc). Lets make it also output the size
in plain bytes so it can be formated depending on language.

Bug: T143770
Change-Id: Idda77fdae4e49a7cf46cce2fcd23c2fb2fe43f9d

7 years agoMerge "mw.htmlform: Don't refer to OO.ui if it might not be loaded"
jenkins-bot [Thu, 25 Aug 2016 17:46:26 +0000 (17:46 +0000)]
Merge "mw.htmlform: Don't refer to OO.ui if it might not be loaded"

7 years agomw.htmlform.ooui.styles: Remove vertical margin from OOjs UI HTMLForms
Bartosz Dziewoński [Wed, 10 Aug 2016 23:33:45 +0000 (01:33 +0200)]
mw.htmlform.ooui.styles: Remove vertical margin from OOjs UI HTMLForms

Originally added in b524a4333f9c1b42bf6ac0f6caa3055bd8acf84a,
this is no longer needed for framed forms (with setWrapperLegend())
after e5bb1f68cf4154c1bc4389a4404808ebddb5cef9 in OOjs UI and was
never needed for non-framed forms at all.

Change-Id: If4b4b8776080a00685bbcb9026a3d5eb89e4167d

7 years agoMerge "HTMLFormField: Don't display empty popup in OOUI mode if empty 'help' is given"
jenkins-bot [Thu, 25 Aug 2016 16:27:45 +0000 (16:27 +0000)]
Merge "HTMLFormField: Don't display empty popup in OOUI mode if empty 'help' is given"

7 years agoMerge "RestbaseVirtualRESTService: Support production URL layout"
jenkins-bot [Thu, 25 Aug 2016 15:04:33 +0000 (15:04 +0000)]
Merge "RestbaseVirtualRESTService: Support production URL layout"

7 years agoMerge "Remove redundant UNIQUE from rev_page_id"
jenkins-bot [Thu, 25 Aug 2016 07:23:34 +0000 (07:23 +0000)]
Merge "Remove redundant UNIQUE from rev_page_id"

7 years agoLinker: Avoid Title in normaliseSpecialPage()
Kunal Mehta [Thu, 25 Aug 2016 06:49:00 +0000 (23:49 -0700)]
Linker: Avoid Title in normaliseSpecialPage()

Now that SpecialPage::getTitleValueFor() exists, use it so that we can
avoid returning a Title object uncessarily.

Change-Id: I5bf605baf2ecad62e189421a2e5c556cc0b6f6ac

7 years agoRemove redundant UNIQUE from rev_page_id
Aaron Schulz [Mon, 11 Apr 2016 21:01:43 +0000 (14:01 -0700)]
Remove redundant UNIQUE from rev_page_id

The PRIMARY KEY is rev_id, so this is a waste and
makes the index slower to maintain (e.g. no change
buffering).

Bug: T142725
Change-Id: I63f817656ff5e62aa27caf607d70353cc99eb349

7 years agomw.htmlform: Don't refer to OO.ui if it might not be loaded
Bartosz Dziewoński [Thu, 25 Aug 2016 04:34:35 +0000 (06:34 +0200)]
mw.htmlform: Don't refer to OO.ui if it might not be loaded

Dependencies are loaded dynamically here, before this code runs.
If there are no OOjs UI HTMLForm fields on the page, then OOjs UI
is not loaded, and the attempt to check if we're working with a
OO.ui.Widget would cause an exception. Invert the test to check
for jQuery, which is always loaded.

Follow-up to 89107070d14187915e760f8543579ec4d784620f.

Bug: T143850
Change-Id: Ibaa5a15fe367ed7470e3e8176e52b13442aeb985

7 years agoMerge "PreprocessorTest: test both implementations"
jenkins-bot [Thu, 25 Aug 2016 03:54:58 +0000 (03:54 +0000)]
Merge "PreprocessorTest: test both implementations"

7 years agoPreprocessorTest: test both implementations
Tim Starling [Thu, 25 Aug 2016 03:17:13 +0000 (13:17 +1000)]
PreprocessorTest: test both implementations

* Instead of only testing the configured preprocessor, test each in turn.
* Fix a test error when testing Preprocessor_Hash by removing <equals>
  tags -- only Preprocessor_Hash emits them, but they have no effect on
  the expansion.

Change-Id: I596f6b66fc636b767c447af3450556bfebe28241

7 years agoMerge "Cleanups to SqlBagOStuff"
jenkins-bot [Thu, 25 Aug 2016 03:04:29 +0000 (03:04 +0000)]
Merge "Cleanups to SqlBagOStuff"

7 years agoMerge "Optimize ChronologyProtector writes for multi-DC case"
jenkins-bot [Thu, 25 Aug 2016 03:00:39 +0000 (03:00 +0000)]
Merge "Optimize ChronologyProtector writes for multi-DC case"

7 years agoMerge "Fix AuthManagerSpecialPage submit button logic"
jenkins-bot [Thu, 25 Aug 2016 02:59:09 +0000 (02:59 +0000)]
Merge "Fix AuthManagerSpecialPage submit button logic"

7 years agoFix AuthManagerSpecialPage submit button logic
Gergő Tisza [Thu, 25 Aug 2016 02:24:51 +0000 (19:24 -0700)]
Fix AuthManagerSpecialPage submit button logic

Bug: T143840
Change-Id: I7fe442f5044c3dce27f89d83b8003dc6e4170296

7 years agoCleanups to SqlBagOStuff
Aaron Schulz [Wed, 24 Aug 2016 21:02:15 +0000 (14:02 -0700)]
Cleanups to SqlBagOStuff

* Keep track of the custom LoadBalancer when it makes one.
* Use the custom LoadBalancer to wait for slaves if one
  was used, rather than the main singleton.
* Only wait on the slaves in the LoadBalancer if the
  main DBs are being used.

Change-Id: I11de814306c44f27e0c33b08b5921c0fd4cdc24f

7 years agoMerge "resourceloader: Improve coverage in ResourceLoaderTest.php"
jenkins-bot [Thu, 25 Aug 2016 02:13:06 +0000 (02:13 +0000)]
Merge "resourceloader: Improve coverage in ResourceLoaderTest.php"

7 years agoresourceloader: Improve coverage in ResourceLoaderTest.php
Timo Tijhof [Thu, 25 Aug 2016 01:50:30 +0000 (18:50 -0700)]
resourceloader: Improve coverage in ResourceLoaderTest.php

* Fix signature of makeLoaderSourcesScript() to match
  the change in behaviour since e103ba265.

* Consistently order providers before the test.

* Simplify testRegisterValid() and remove needless @depends.

* Remove unused private method stripNoflip().

Coverage:

* Expand test coverage for register().

* Add tests for getModuleNames().

* Add tests for getModule().

* Expand test coverage for addSource().
  (case of invalid array)

* Expand test coverage for makeLoaderImplementScript().
  (case of unwrapped user script, and case of invalid scripts)

* Add tests for makeLoaderSourcesScript().

Change-Id: Ibca3e486fcd3664f171f135327a0f340ee6da9ee

7 years agoClear SiteStats process cache after DB update
Tim Starling [Thu, 25 Aug 2016 01:37:38 +0000 (11:37 +1000)]
Clear SiteStats process cache after DB update

This fixes a phpunit test error, wherein {{NUMBEROFFILES}} would give
the number of files in the host wiki, not in the temporary database,
when Scribunto was installed, due to a Scribunto phpunit data provider
calling SiteStats::pages().

Change-Id: Ic0d021a72addaa2a13a6b94fd34dccc423de3a8f

7 years agoMerge "API: Log when too many values are passed for a multi-valued parameter"
jenkins-bot [Wed, 24 Aug 2016 23:34:04 +0000 (23:34 +0000)]
Merge "API: Log when too many values are passed for a multi-valued parameter"

7 years agodebug: Interpolate log messages
Kunal Mehta [Wed, 24 Aug 2016 23:12:02 +0000 (16:12 -0700)]
debug: Interpolate log messages

Change-Id: Ib61a50863022db796d69264bf738fb0b22f776e9

7 years agodebug: Merge mediawiki.debug.init module into mediawiki.debug
Kunal Mehta [Wed, 24 Aug 2016 23:00:09 +0000 (16:00 -0700)]
debug: Merge mediawiki.debug.init module into mediawiki.debug

It just calls mw.Debug.init() on document ready, which can easily be
done inside mediawiki.debug.

Change-Id: Ifaa5a4884c9e430241a4bff51454bb96f468cd61

7 years agodebug: Don't show git branch if on a detached HEAD
Kunal Mehta [Wed, 24 Aug 2016 22:44:41 +0000 (15:44 -0700)]
debug: Don't show git branch if on a detached HEAD

The short SHA1 is already shown with the MediaWiki version, and
displaying the full SHA1 again adds 40+ more characters. Mostly this
annoys me as it causes the toolbar to wrap earlier when making my
browser window smaller.

Change-Id: If7474a090466de708d65cef6dcc30a36df56621f

7 years agoMerge "Add LBFactory::beginMasterChanges() for doing DBO_TRX rounds"
jenkins-bot [Wed, 24 Aug 2016 20:21:14 +0000 (20:21 +0000)]
Merge "Add LBFactory::beginMasterChanges() for doing DBO_TRX rounds"

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 24 Aug 2016 19:55:28 +0000 (21:55 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: If5f82b2d32ab93592dd54cf21cb5d36c52315936

7 years agoOptimize ChronologyProtector writes for multi-DC case
Aaron Schulz [Mon, 22 Aug 2016 02:14:54 +0000 (19:14 -0700)]
Optimize ChronologyProtector writes for multi-DC case

Change-Id: Iecd218043814ac0963c67b16d043e697a6933741

7 years agoMerge "Call ssl_set() in DatabaseMysqli if DBO_SSL is set"
jenkins-bot [Wed, 24 Aug 2016 19:46:02 +0000 (19:46 +0000)]
Merge "Call ssl_set() in DatabaseMysqli if DBO_SSL is set"

7 years agoMerge "Move Article checkLastModified() up to MediaWiki::performRequest"
jenkins-bot [Wed, 24 Aug 2016 18:55:15 +0000 (18:55 +0000)]
Merge "Move Article checkLastModified() up to MediaWiki::performRequest"

7 years agoMerge "Make Special:CreateAccount respect ?returnto parameter"
jenkins-bot [Wed, 24 Aug 2016 17:55:41 +0000 (17:55 +0000)]
Merge "Make Special:CreateAccount respect ?returnto parameter"

7 years agoMake Special:CreateAccount respect ?returnto parameter
Aaron Schulz [Sat, 20 Aug 2016 22:43:57 +0000 (15:43 -0700)]
Make Special:CreateAccount respect ?returnto parameter

Change-Id: I074ee184ad1fec84ef2e93eea8397d932e96e0cd

7 years agoMerge "Sync up with Parsoid parserTests."
jenkins-bot [Wed, 24 Aug 2016 17:14:35 +0000 (17:14 +0000)]
Merge "Sync up with Parsoid parserTests."

7 years agoSync up with Parsoid parserTests.
Subramanya Sastry [Wed, 24 Aug 2016 16:40:58 +0000 (11:40 -0500)]
Sync up with Parsoid parserTests.

This now aligns with Parsoid commit 47e085881094299aa652320aba1dfb5b99855690

Change-Id: I2da551dc9d8568c56decbabcad8bcf8d57680b47

7 years agoAPI: Log when too many values are passed for a multi-valued parameter
Brad Jorsch [Wed, 24 Aug 2016 16:10:05 +0000 (12:10 -0400)]
API: Log when too many values are passed for a multi-valued parameter

Currently the API just throws away the excess values, no continuation.
This is probably not the best behavior. There is a warning, but clients
are notorious for just ignoring warnings.

We could improve the situation:
* Turn it into an error.
* Turn it into an error for most cases, but allow some to override if
  necessary.
* Allow some cases to make it an error, while keeping it a warning by
  default.

Before we can decide which option to pick, we should get an idea of how
often this is being hit and which things it's being hit for.

Bug: T41936
Change-Id: I52926f410c30d1cd7e7fcd86465b16519fb5cbd2

7 years agoHTMLFormField: Don't display empty popup in OOUI mode if empty 'help' is given
Bartosz Dziewoński [Wed, 10 Aug 2016 19:40:40 +0000 (21:40 +0200)]
HTMLFormField: Don't display empty popup in OOUI mode if empty 'help' is given

Change-Id: I1aa68dcb9cdf1584f65436a641b119f0d61537ef

7 years agoHTMLFormField: Move 'flatlist' handling to fields that use it and document
Bartosz Dziewoński [Mon, 8 Aug 2016 20:55:25 +0000 (22:55 +0200)]
HTMLFormField: Move 'flatlist' handling to fields that use it and document

Change-Id: I5dc6ad71880a741c41757bc64d236971edfbabfa

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 24 Aug 2016 07:51:59 +0000 (09:51 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib1a471eb8e9692fab1e5d66cf6711388ea2e20cc

7 years agoMove Article checkLastModified() up to MediaWiki::performRequest
Aaron Schulz [Wed, 24 Aug 2016 06:53:31 +0000 (23:53 -0700)]
Move Article checkLastModified() up to MediaWiki::performRequest

This lets revalidations via IMS headers run a bit faster.

Change-Id: I1f61086dea4c6bc460f6249ed7fda78316117a8d

7 years agoMerge "VirtualRESTServiceClient management cleanups"
jenkins-bot [Wed, 24 Aug 2016 03:30:55 +0000 (03:30 +0000)]
Merge "VirtualRESTServiceClient management cleanups"

7 years agoMerge "Avoid INSERT..SELECT in LocalFileDeleteBatch"
jenkins-bot [Wed, 24 Aug 2016 03:25:26 +0000 (03:25 +0000)]
Merge "Avoid INSERT..SELECT in LocalFileDeleteBatch"

7 years agoVirtualRESTServiceClient management cleanups
Aaron Schulz [Mon, 22 Aug 2016 00:14:57 +0000 (17:14 -0700)]
VirtualRESTServiceClient management cleanups

* Add getVirtualRESTServiceClient() to MediaWikiServices.
* Support auto-mounting services that are usable by the
  main MediaWikiServices instance.
* Support lazy-loading in mount(), where only class/args
  are set until the service is needed. This avoids excess
  overhead.

Change-Id: I5c22be59664b3f5716c957e2c3d7c8e70d5fdc6c

7 years agoMerge "A few more DBLockManager fixes and cleanups"
jenkins-bot [Wed, 24 Aug 2016 03:15:31 +0000 (03:15 +0000)]
Merge "A few more DBLockManager fixes and cleanups"

7 years agoMerge "Remove some unused hooks from hooks.txt"
jenkins-bot [Wed, 24 Aug 2016 02:53:59 +0000 (02:53 +0000)]
Merge "Remove some unused hooks from hooks.txt"

7 years agoRemove some unused hooks from hooks.txt
Gergő Tisza [Wed, 24 Aug 2016 02:35:17 +0000 (19:35 -0700)]
Remove some unused hooks from hooks.txt

These were removed in I2b2c9693a.

Change-Id: I31c2ff3ce9d734fab94695bd3e8eb85cbf65803f

7 years agoEditPage: Use context instead of globals (4/4)
Kunal Mehta [Wed, 24 Aug 2016 01:55:56 +0000 (18:55 -0700)]
EditPage: Use context instead of globals (4/4)

Change-Id: Ie84bceb0ac0940a7d14b9790eb8ab81321b20629

7 years agoEditPage: Use context instead of globals (3/4)
Kunal Mehta [Wed, 24 Aug 2016 01:39:38 +0000 (18:39 -0700)]
EditPage: Use context instead of globals (3/4)

Change-Id: Id4f905c8db35d5c64375f55e2040d40b04f18dee

7 years agoEditPage: Use context instead of globals (2/4)
Kunal Mehta [Wed, 24 Aug 2016 01:23:20 +0000 (18:23 -0700)]
EditPage: Use context instead of globals (2/4)

Change-Id: I3b727fa5cb42ca2a7abf1a54fe4f2b4996f5150c

7 years agoEditPage: Use context instead of globals (1/4)
Kunal Mehta [Wed, 24 Aug 2016 00:56:38 +0000 (17:56 -0700)]
EditPage: Use context instead of globals (1/4)

Change-Id: Ie4e9c492679a75d753b69fb09f510564b9e7f0a8

7 years agoEditPage: Fix some doc blocks
Kunal Mehta [Wed, 24 Aug 2016 00:48:55 +0000 (17:48 -0700)]
EditPage: Fix some doc blocks

Change-Id: I0399df658b3b9c000b72dacbdc4ea18678a32db4

7 years agoEditPage: Add getContext() function
Kunal Mehta [Wed, 24 Aug 2016 00:48:43 +0000 (17:48 -0700)]
EditPage: Add getContext() function

EditPage already has access to a IContextSource object via
$this->mArticle->getContext(), but no code ever uses it. Add a
$this->getContext() helper function and $this->context member variable
so developers are aware that RequestContext is available and should be
used instead of globals. This is the first step to de-globalifying
EditPage.

Change-Id: I17130bdaf214e9bbe0577a0ee5564ca4760c99e1

7 years agoAdd LBFactory::beginMasterChanges() for doing DBO_TRX rounds
Aaron Schulz [Mon, 22 Aug 2016 05:35:12 +0000 (22:35 -0700)]
Add LBFactory::beginMasterChanges() for doing DBO_TRX rounds

This is in intended to replace the DataUpdate transaction round logic.
It could also be useful for doing transaction rounds in maintenance
scripts.

Also renamed $db => $conn in a few LB methods for consistency.

Change-Id: If21c2ba5e8bac48c250b96137279e7edaa8289f7

7 years agoMerge "EditPage: Allow the 'save' button's label to be 'publish' for public wikis"
jenkins-bot [Wed, 24 Aug 2016 00:17:38 +0000 (00:17 +0000)]
Merge "EditPage: Allow the 'save' button's label to be 'publish' for public wikis"

7 years agoMerge "EditPage: Show a different label for the button on create vs. modify"
jenkins-bot [Wed, 24 Aug 2016 00:14:38 +0000 (00:14 +0000)]
Merge "EditPage: Show a different label for the button on create vs. modify"

7 years agoMerge "HTMLMultiSelectField: Add 'dropdown' option for 'mw-chosen' behavior and document"
Krinkle [Tue, 23 Aug 2016 22:16:27 +0000 (22:16 +0000)]
Merge "HTMLMultiSelectField: Add 'dropdown' option for 'mw-chosen' behavior and document"

7 years agoMerge "Upgrade justinrainbow/json-schema to ~3.0"
jenkins-bot [Tue, 23 Aug 2016 21:33:56 +0000 (21:33 +0000)]
Merge "Upgrade justinrainbow/json-schema to ~3.0"

7 years agoUpgrade justinrainbow/json-schema to ~3.0
Florian Schmidt [Mon, 15 Aug 2016 17:36:00 +0000 (19:36 +0200)]
Upgrade justinrainbow/json-schema to ~3.0

The release between 1.6.1 and 3.0.0 has a huge amount of code
maintenance changes, as well as internal optimization and some
"visible" changes (as well as the one mentioned in the linked
task).

However, it's a version jump over 2 major versions, which is,
by it's definition a major change ;). Nonetheless, the (for us)
important api has changed marginally: Instead of using the
JsonSchema\Uri\UriRetriever class to retrieve the schema, we now use
the $ref keyword to reference the json schema file (which also is
an internal optimization). In this way, we let the json-schema library
decide, how to resolve a ref (and the schema) instead of relying
on the UriRetriever api to be public and stable.

The versions also include various bug fixes (which, as far as I know,
doesn't apply to us).

I tested this change with various combinations of valid and invalid
extension.json schemas (version 2 as well as version 3). Given that
there were no major changes to the schema interpretation itself, and
the good test coverage of the library, there shouldn't be a high risk
because of this change.

The full list of changes can be found at:
https://github.com/justinrainbow/json-schema/compare/1.6.1...3.0.0

as well as the changelogs of the single versions:
https://github.com/justinrainbow/json-schema/releases

Bug: T141281
Depends-On: I5687286da9f7fa2bb2b84699fa43ab3c2547fe03
Change-Id: Ie37e2ebc48684783abf8d99d2f775ee6a5988da7

7 years agoCloneDatabase: Simplify callback structure
Chad Horohoe [Tue, 23 Aug 2016 19:16:01 +0000 (12:16 -0700)]
CloneDatabase: Simplify callback structure

Change-Id: I4d5184fd7417e61e9a111bd414f8c62539229ef9

7 years agoImplement NumericUppercaseCollation
Bartosz Dziewoński [Wed, 27 Jul 2016 14:43:01 +0000 (16:43 +0200)]
Implement NumericUppercaseCollation

This collation orders text with numbers "naturally", so that
'Foo 1' < 'Foo 2' < 'Foo 12'.

Note that this only works in terms of sequences of digits, and the
behavior for decimal fractions or pretty-formatted numbers may be
unexpected.

This is only expected to work mostly correctly for English-language
text. Consider it a proof of concept. You probably want to use
an UCA collation with '-u-kn' suffix rather than this.

Bug: T8948
Change-Id: Ie268f2d92c5c75d0aaecf54ede2bdda1af3b309d

7 years agoMerge "content: Refactor normalization of line endings code"
jenkins-bot [Tue, 23 Aug 2016 18:33:34 +0000 (18:33 +0000)]
Merge "content: Refactor normalization of line endings code"

7 years agocontent: Refactor normalization of line endings code
Kunal Mehta [Tue, 16 Aug 2016 21:58:15 +0000 (14:58 -0700)]
content: Refactor normalization of line endings code

The code that normalizes line endings ("\r\n" and "\r" to "\n") and
trims trailing whitespace is buried in Parser::preSaveTransform(), and
was duplicated to TextContent in 96b6afb31dfcff, as non-wikitext content
models should still be normalizing line endings.

This splits the duplicated code into
TextContent::normalizeLineEndings(), and utilize it in the Parser.
Additionally, expand the documentation of
TextContent::preSaveTransform() to document that subclasses should make
sure they normalize line endings during the PST stage.

And remove a useless rtrim() call from WikitextContent that did nothing.

Change-Id: I9094c671d4bbd23d75436f8f1d682d6dd6e6d2fc

7 years agoMerge "Avoid INSERT..SELECT in doArticleDeleteReal()"
jenkins-bot [Tue, 23 Aug 2016 18:09:35 +0000 (18:09 +0000)]
Merge "Avoid INSERT..SELECT in doArticleDeleteReal()"

7 years agoRemove commit() calls from JobQueueDB
Aaron Schulz [Tue, 23 Aug 2016 05:23:58 +0000 (22:23 -0700)]
Remove commit() calls from JobQueueDB

These are not safe for the common case where the local DB
handle is used for the queue (and other table writes).

Change-Id: Ic24a05c18bf31e49bf7e9a3c058deb5d35271511

7 years agoAvoid INSERT..SELECT in LocalFileDeleteBatch
Aaron Schulz [Tue, 23 Aug 2016 17:10:48 +0000 (10:10 -0700)]
Avoid INSERT..SELECT in LocalFileDeleteBatch

That construct has poor locking characteristics in terms of
auto-inc columns as well as not allowing such inserts concurrently
for statement-based replication. Also, the INSERT..SELECT did not
have an ORDER BY, which could lead to fa_id drift with statement
based replication.

Change-Id: Iaacb75d9931b4cd24b70bdcaadd0e3979c7e9c90

7 years agoAvoid INSERT..SELECT in doArticleDeleteReal()
Aaron Schulz [Fri, 19 Aug 2016 09:06:11 +0000 (02:06 -0700)]
Avoid INSERT..SELECT in doArticleDeleteReal()

That construct has poor locking characteristics in terms of
auto-inc columns as well as not allowing such inserts concurrently
for statement-based replication. Also, the INSERT..SELECT did not
have an ORDER BY, which could lead to ar_id drift with statement
based replication.

Change-Id: I9396869e474bc082fa6161b60afa3a5247df773b

7 years agoMerge "Tell users that js/css subpages are public"
Dpatrick [Tue, 23 Aug 2016 16:38:53 +0000 (16:38 +0000)]
Merge "Tell users that js/css subpages are public"

7 years agoMerge "Reduce problems caused by $wgRunJobsAsync"
jenkins-bot [Tue, 23 Aug 2016 16:25:23 +0000 (16:25 +0000)]
Merge "Reduce problems caused by $wgRunJobsAsync"

7 years agoFix broken lockmanager-fail-releaselock status messages
Aaron Schulz [Tue, 23 Aug 2016 15:57:28 +0000 (08:57 -0700)]
Fix broken lockmanager-fail-releaselock status messages

Change-Id: Icb0cfa6e38bc81c35430023afe50dd94ef3b2013

7 years agoMerge "Expose form field objects in HTMLForm"
jenkins-bot [Tue, 23 Aug 2016 15:52:26 +0000 (15:52 +0000)]
Merge "Expose form field objects in HTMLForm"

7 years agoMerge "Make login/signup footer available to AuthChangeFormFields hook"
jenkins-bot [Tue, 23 Aug 2016 15:25:13 +0000 (15:25 +0000)]
Merge "Make login/signup footer available to AuthChangeFormFields hook"

7 years agoMerge "Improve default behavior for HTMLForm::canDisplayErrors"
jenkins-bot [Tue, 23 Aug 2016 15:12:24 +0000 (15:12 +0000)]
Merge "Improve default behavior for HTMLForm::canDisplayErrors"

7 years agoMerge "mw.widgets.CategoryCapsuleItemWidget: Debug logging for "queue[title] is undef...
jenkins-bot [Tue, 23 Aug 2016 14:18:39 +0000 (14:18 +0000)]
Merge "mw.widgets.CategoryCapsuleItemWidget: Debug logging for "queue[title] is undefined""

7 years agomw.widgets.CategoryCapsuleItemWidget: Debug logging for "queue[title] is undefined"
Bartosz Dziewoński [Tue, 23 Aug 2016 13:50:13 +0000 (15:50 +0200)]
mw.widgets.CategoryCapsuleItemWidget: Debug logging for "queue[title] is undefined"

Bug: T139130
Change-Id: Icd852a0b0d5cc42863965e303c410d1be50ff364

7 years agoMerge "SpecialMyLanguage: Use page language instead of wiki language for redirect...
jenkins-bot [Tue, 23 Aug 2016 13:28:12 +0000 (13:28 +0000)]
Merge "SpecialMyLanguage: Use page language instead of wiki language for redirect target check"

7 years agoSpecialMyLanguage: Use page language instead of wiki language for redirect target...
Florian [Fri, 18 Dec 2015 02:26:23 +0000 (03:26 +0100)]
SpecialMyLanguage: Use page language instead of wiki language for redirect target check

With the change, named in Follow up, it's possible for site owners to
allow to change the language of a page using a special page.
Theoretically, any page can have another or a different page language,
depending on, if the language was changed using the special page or not.
For Special:MyLanguage it isn't enough anymore to check, if the current
user language is the same as the default content language. It has to
check, if the page language (which can potentionally differ from the
default content language) is the same as the user language.

The problem:
If content language is the same as the user language, Special:MyLanguage
currently redirects to the "base page" of a page ("Testpage" instead of
"Testpage/de"), no matter, if the page language of the base part is
another one as the default content language. This can result in the
problem, that Special:MyLanguage redirects to a page, that has a
different language as the user language, even if a subpage with the user
language code exists. This is fixed with this change.

Follow up: I0f82b146fbe948f917c1

Bug: T121834
Change-Id: Ic9fc9049813c153111829d37a2c248dc0768e0fb

7 years agoMerge "Introduce {{#time: xit}} for days in the month in Iranian calendar"
jenkins-bot [Tue, 23 Aug 2016 12:54:48 +0000 (12:54 +0000)]
Merge "Introduce {{#time: xit}} for days in the month in Iranian calendar"

7 years agoMerge "User namespace localisation update for Slovak"
jenkins-bot [Tue, 23 Aug 2016 12:49:43 +0000 (12:49 +0000)]
Merge "User namespace localisation update for Slovak"

7 years agoOutputPage.php: Reuse existing variable $user
Fomafix [Tue, 23 Aug 2016 07:12:35 +0000 (07:12 +0000)]
OutputPage.php: Reuse existing variable $user

Follows-up to 81c291f2

Change-Id: Id32daf74549c8af886a46119b30ff29ab2a6ac94

7 years agoMerge "objectcache: Add missing @covers to unit tests"
jenkins-bot [Tue, 23 Aug 2016 07:00:55 +0000 (07:00 +0000)]
Merge "objectcache: Add missing @covers to unit tests"

7 years agoobjectcache: Add missing @covers to unit tests
Timo Tijhof [Tue, 23 Aug 2016 06:20:42 +0000 (23:20 -0700)]
objectcache: Add missing @covers to unit tests

* HashBagOStuff: 100%
* CachedBagOStuff: 64%
* MultiWriteBagOStuff: 33%

Change-Id: I50bb8f5eda7eabadb5fd4b841af42b3bbcaf9611

7 years agoReduce problems caused by $wgRunJobsAsync
Aaron Schulz [Tue, 23 Aug 2016 06:04:36 +0000 (23:04 -0700)]
Reduce problems caused by $wgRunJobsAsync

* Use getCanonicalURL() to avoid links with the wrong host (e.g.
  when it is virtual) and to avoid getting redirects.
* Also disable this setting when post-send execution is already
  available, by default.
* Bump the socket timeout slightly.

Bug: T107290
Bug: T68485
Change-Id: I56c43193fa6583cc0c8209ff59cf20c986a799a3

7 years agoCode cleanups to SqlBagOStuff
Aaron Schulz [Tue, 23 Aug 2016 01:41:05 +0000 (18:41 -0700)]
Code cleanups to SqlBagOStuff

* Refactor local DB usage check into usesMainDB() method.
* Avoid using the db member of DBError instances.

Change-Id: I7350f5a471c551492094bfaf545ebc222eb6f7dd

7 years agoMerge "Pingback: Tweak docs a tiny bit to point to mw.org better"
jenkins-bot [Tue, 23 Aug 2016 05:09:43 +0000 (05:09 +0000)]
Merge "Pingback: Tweak docs a tiny bit to point to mw.org better"

7 years agoA few more DBLockManager fixes and cleanups
Aaron Schulz [Tue, 23 Aug 2016 05:04:43 +0000 (22:04 -0700)]
A few more DBLockManager fixes and cleanups

* Do not do the connection init step if the same DB handle as
  wfGetDB( DB_MASTER ) is being used to avoid clobbering it.
* Remove begin(), since only one of the subclasses wants
  transactions. That one now uses startAtomic() now.
* Make getConnection() throw an error for bad config instead
  of return null, which was not documented or expected.

Change-Id: Ib09a7972d6569c29e83e329a8f7f9f47a393b896

7 years agoMerge "Move EnqueueableDataUpdate to a separate file"
jenkins-bot [Tue, 23 Aug 2016 04:57:41 +0000 (04:57 +0000)]
Merge "Move EnqueueableDataUpdate to a separate file"

7 years agoMerge "Release notes for all the previous security patches"
jenkins-bot [Tue, 23 Aug 2016 04:48:17 +0000 (04:48 +0000)]
Merge "Release notes for all the previous security patches"

7 years agoMerge "Remove redundant isLoggedIn() call"
jenkins-bot [Tue, 23 Aug 2016 04:39:59 +0000 (04:39 +0000)]
Merge "Remove redundant isLoggedIn() call"

7 years agoRelease notes for all the previous security patches
Chad Horohoe [Mon, 22 Aug 2016 19:39:05 +0000 (12:39 -0700)]
Release notes for all the previous security patches

Change-Id: Ie93338b7d41a90f3ffdfa1b41891994935c965c7

7 years agoMerge "SECURITY: Move 'UserGetRights' call before application of Session::getAllowedU...
jenkins-bot [Tue, 23 Aug 2016 04:34:38 +0000 (04:34 +0000)]
Merge "SECURITY: Move 'UserGetRights' call before application of Session::getAllowedUserRights()"

7 years agoMerge "Remove commit() hack from User::addToDatabase()"
jenkins-bot [Tue, 23 Aug 2016 04:29:20 +0000 (04:29 +0000)]
Merge "Remove commit() hack from User::addToDatabase()"

7 years agoMerge "Various database class cleanups"
jenkins-bot [Tue, 23 Aug 2016 04:23:26 +0000 (04:23 +0000)]
Merge "Various database class cleanups"

7 years agoMove EnqueueableDataUpdate to a separate file
Aaron Schulz [Tue, 23 Aug 2016 04:20:49 +0000 (21:20 -0700)]
Move EnqueueableDataUpdate to a separate file

Change-Id: Iabc291cd1f3c5390ca8bcc5da64a0ff01a082575