lhc/web/wiklou.git
9 years agoMade SqlBagOStuff unset DB handles on connection errors
Aaron Schulz [Tue, 23 Jun 2015 19:28:03 +0000 (12:28 -0700)]
Made SqlBagOStuff unset DB handles on connection errors

* A "gone away" error can trigger ping(), which can fail,
  triggering a full open(). If this fails (as it often will),
  mConn is false and the DatabaseBase object is not usable.

Bug: T103435
Change-Id: Id2aaed87d2642e73c7811076da908180ee5ab5a4

9 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 23 Jun 2015 18:54:09 +0000 (20:54 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I0f85bdd122e4ce9f3e7b809b35aefc6aa2aacca3

9 years agoMerge "API: Change default continuation format for action=query"
jenkins-bot [Tue, 23 Jun 2015 18:40:09 +0000 (18:40 +0000)]
Merge "API: Change default continuation format for action=query"

9 years agoAdd RejectParserCacheValue hook
Ori Livneh [Tue, 23 Jun 2015 05:09:53 +0000 (22:09 -0700)]
Add RejectParserCacheValue hook

Add a new hook, 'RejectParserCacheValue', which allows extensions to reject an
otherwise-successful parser cache lookup. The intent is to allow extensions to
manage the eviction of archaic HTML output from the cache.

Change-Id: I660679a48c46608f859bd52b31d6a888aabcc9ac

9 years agoMerge "Set Southern Kurdish to use Kurdish ordered list style type"
jenkins-bot [Tue, 23 Jun 2015 11:35:48 +0000 (11:35 +0000)]
Merge "Set Southern Kurdish to use Kurdish ordered list style type"

9 years agoMerge "EditPage: Check $wgContentHandlerUseDB"
jenkins-bot [Tue, 23 Jun 2015 11:14:17 +0000 (11:14 +0000)]
Merge "EditPage: Check $wgContentHandlerUseDB"

9 years agoMerge "Hygiene: Use [i] instead of charAt(i) for string index access"
jenkins-bot [Tue, 23 Jun 2015 10:55:51 +0000 (10:55 +0000)]
Merge "Hygiene: Use [i] instead of charAt(i) for string index access"

9 years agoMerge "Added pre-emptive session renewal to avoid "random" submission errors"
jenkins-bot [Tue, 23 Jun 2015 10:51:21 +0000 (10:51 +0000)]
Merge "Added pre-emptive session renewal to avoid "random" submission errors"

9 years agoMerge "MediaWiki.php: Factor out tryNormaliseRedirect"
jenkins-bot [Tue, 23 Jun 2015 09:14:04 +0000 (09:14 +0000)]
Merge "MediaWiki.php: Factor out tryNormaliseRedirect"

9 years agoMerge "Implement wfGlobalCacheKey() for database-agnostic keys"
jenkins-bot [Tue, 23 Jun 2015 07:15:05 +0000 (07:15 +0000)]
Merge "Implement wfGlobalCacheKey() for database-agnostic keys"

9 years agoImplement wfGlobalCacheKey() for database-agnostic keys
Timo Tijhof [Tue, 23 Jun 2015 04:52:30 +0000 (05:52 +0100)]
Implement wfGlobalCacheKey() for database-agnostic keys

Some code paths abuse wfForeignMemcKey() for this purpose. This is semantically
incorrect and seems fragile. Also the empty second argument (for db-prefix) is
either misused or akwardly set to the empty string.

It also creates a namespace conflict between arbitrary application keys (from
the software) and any database names (from users). This commit reduces the
conflict surface down to a single key (namely, "global").

Also added unit tests to assert the implicit restrictions and
assumptions between these cache key functions are valid.

Change-Id: Ia0953b51005fe3de3b881dd1bd64c9d3c85e8c66

9 years agoMediaWiki.php: Factor out tryNormaliseRedirect
Timo Tijhof [Fri, 19 Jun 2015 19:56:36 +0000 (20:56 +0100)]
MediaWiki.php: Factor out tryNormaliseRedirect

This is in preparation for fixing T67402, which requires adding
logic inside this condition block. However the to-be-added code
will influences whether or not a redirect should be made.

In case a redirect is not made, it has to fall through to the next
'elseif' handler in MediaWiki::performRequest(), which is not possible
from inside the 'if' block.

Hence, move it out in a separate block and use a boolean return value
to communicate whether the case has been handled.

This also allows us to unit test this thing. Which is desperately
needed. Albeit ugly as it requires lots of mocking.

Change-Id: If3157f2ff1fd3ab2ca20a5d1f550d864ea62c493

9 years agoMerge "Rename WikiPage::isParserCacheUsed to WikiPage::shouldCheckParserCache"
jenkins-bot [Tue, 23 Jun 2015 04:14:15 +0000 (04:14 +0000)]
Merge "Rename WikiPage::isParserCacheUsed to WikiPage::shouldCheckParserCache"

9 years agoMerge "Suppress deprecation warnings in 'jquery.mwExtension.test'"
jenkins-bot [Tue, 23 Jun 2015 04:00:45 +0000 (04:00 +0000)]
Merge "Suppress deprecation warnings in 'jquery.mwExtension.test'"

9 years agoRename WikiPage::isParserCacheUsed to WikiPage::shouldCheckParserCache
Ori Livneh [Tue, 23 Jun 2015 03:38:43 +0000 (20:38 -0700)]
Rename WikiPage::isParserCacheUsed to WikiPage::shouldCheckParserCache

'isParserCachedUsed' implies that the parser cache usage has already occurred,
and obscures the true purpose of this method, which is to determine whether or
not the requested page *should* be looked up in the parser cache.

Only usage in extensions is in TextExtracts, which I changed to be both
backward- and forward-compatible in If5d5da8eab13.

Change-Id: I7de67937f0e57b1dffb466319192e4d400b867de

9 years agoSuppress deprecation warnings in 'jquery.mwExtension.test'
Timo Tijhof [Tue, 23 Jun 2015 02:39:36 +0000 (03:39 +0100)]
Suppress deprecation warnings in 'jquery.mwExtension.test'

Follows-up b0ee0c0.

Change-Id: I1e38ec9b7e822c177e038b2c83827a3910fe75ad

9 years agoDeclare .icc files to be binary in .gitattributes
Ori Livneh [Tue, 23 Jun 2015 03:48:58 +0000 (20:48 -0700)]
Declare .icc files to be binary in .gitattributes

Follows I2ae35ddad: TinyRGB support for JPG thumbnails.

Change-Id: Ib8e7a74a6bc7b6cfbc674c8e271faa35b1f1a3c7

9 years agoellapsed => elapsed
Ori Livneh [Tue, 23 Jun 2015 03:31:22 +0000 (20:31 -0700)]
ellapsed => elapsed

Also fix some files that don't end with a newline.

Change-Id: Id0672d685b929a5832b42f733dad49683536180a

9 years agoWikiPage::isParserCacheUsed: change 'oldid' to 'oldId'
Ori Livneh [Tue, 23 Jun 2015 03:26:48 +0000 (20:26 -0700)]
WikiPage::isParserCacheUsed: change 'oldid' to 'oldId'

Change-Id: Ic68206a1f276c9e5a5b09ed5e2b0422589dfa161

9 years agoHygiene: Use [i] instead of charAt(i) for string index access
Timo Tijhof [Mon, 22 Jun 2015 23:33:32 +0000 (00:33 +0100)]
Hygiene: Use [i] instead of charAt(i) for string index access

Was mostly this way for IE6 compatibility which is no longer
relevant for our JavaScript runtime.

Change-Id: I7c441c7b40f40bb2974c4da5ea9f7a87119e7462

9 years agoFix undeclared dependency on jquery.mwExtension
Ori Livneh [Mon, 22 Jun 2015 22:12:35 +0000 (15:12 -0700)]
Fix undeclared dependency on jquery.mwExtension

Since jquery.mwExtension is deprecated, fix the undeclared dependency by making
the module not depend on $.ucFirst rather than by declaring the dependency.

Change-Id: I32b57662464e7dde0f61d6875196764fb61dcfba

9 years agoMerge "Make proxy behaviour of detectServer() configurable"
jenkins-bot [Mon, 22 Jun 2015 22:00:06 +0000 (22:00 +0000)]
Merge "Make proxy behaviour of detectServer() configurable"

9 years agoMake proxy behaviour of detectServer() configurable
Gilles Dubuc [Mon, 22 Jun 2015 18:59:05 +0000 (20:59 +0200)]
Make proxy behaviour of detectServer() configurable

Bug: T75510
Change-Id: Ia6540962f8d913d925547189e101124f76d969c7

9 years agoMerge "Restore namespace-number keys in APIQuerySiteinfo siprop=namespaces"
jenkins-bot [Mon, 22 Jun 2015 19:08:25 +0000 (19:08 +0000)]
Merge "Restore namespace-number keys in APIQuerySiteinfo siprop=namespaces"

9 years agoMerge "Use Linker::linkKnown for some links to MediaWiki pages from navigation"
jenkins-bot [Mon, 22 Jun 2015 19:05:05 +0000 (19:05 +0000)]
Merge "Use Linker::linkKnown for some links to MediaWiki pages from navigation"

9 years agoMerge "Fix comment for grep in SpecialWantedfiles.php"
jenkins-bot [Mon, 22 Jun 2015 19:05:01 +0000 (19:05 +0000)]
Merge "Fix comment for grep in SpecialWantedfiles.php"

9 years agoMerge "Avoid undefined index on Special:Tags"
jenkins-bot [Mon, 22 Jun 2015 19:04:55 +0000 (19:04 +0000)]
Merge "Avoid undefined index on Special:Tags"

9 years agoMerge "Add LinkBatch to ImagePage for user pages in the file history"
jenkins-bot [Mon, 22 Jun 2015 19:04:48 +0000 (19:04 +0000)]
Merge "Add LinkBatch to ImagePage for user pages in the file history"

9 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 22 Jun 2015 18:52:00 +0000 (20:52 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I414ed14d3d4e5a06c093eccd27ef73516239ac75

9 years agoMerge "Construct clean canonical URLs for wiki pages, ignoring request URL"
jenkins-bot [Mon, 22 Jun 2015 18:18:40 +0000 (18:18 +0000)]
Merge "Construct clean canonical URLs for wiki pages, ignoring request URL"

9 years agoConstruct clean canonical URLs for wiki pages, ignoring request URL
Ori Livneh [Mon, 22 Jun 2015 04:26:22 +0000 (21:26 -0700)]
Construct clean canonical URLs for wiki pages, ignoring request URL

Canonical URLs allow webmasters to indicate the preferred URL form for
accessing some content that can be reached via a multitude of URL patterns.
It is usually (but not always) distinct from the request URL, which may
feature things like aliases and session-specific query parameters.
We currently derive canonical URLs from request URLs, which is backwards:
it is the web application, not the client, that ought to know the canonical
way to refer to some content.

This patch ensures MediaWiki derives a clean canonical URL for all wiki
pages from the request context's title object and action.

For some assurance that this is the correct approach, see:
  http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

This Google blog post identifies Wikia as exemplary in its usage of canonical
URLs. Wikia disregards things like the requested revision ID (oldid=NNN) when
constructing the canonical URL. See, for example:
  http://fallout.wikia.com/wiki/Aqua_Pura_delivery_program?oldid=2171222

Wikia goes as far as canonicalizing the action=history to the page view URL.
I think that this is incorrect, because the history and info actions are not
views of the page content, but rather its associated metadata.

This affects all requests where "setArticleRelated" is true. This is typically
all urls that show content (title query, curid, oldid, diff), and all actions
thereof (edit, delete, purge, info, history etc.). It does not apply to
File pages and Special pages.

Bug: T67402
Change-Id: I1549ca056637981a0d751020c634b9fab387f7bc

9 years agoEditPage: Check $wgContentHandlerUseDB
Kunal Mehta [Sat, 20 Jun 2015 04:32:30 +0000 (21:32 -0700)]
EditPage: Check $wgContentHandlerUseDB

Reject any edits that attempt to change the content model of a page if
$wgContentHandlerUseDB is false.

Change-Id: Ic2e0ed8f74c3a54864793a457a452f72fe637f73

9 years agoTinyRGB support for JPG thumbnails
Gilles Dubuc [Mon, 15 Jun 2015 16:23:46 +0000 (18:23 +0200)]
TinyRGB support for JPG thumbnails

TinyRGB is an ICC profile released by Facebook under CC0.
It is designed to be fully compatible with sRGB.
It offers the vast advantages of being much smaller than sRGB,
as well as being free as in freedom (the sRGB profile found in the
majority of JPGs is copyrighted).

This change aims to provide the ability to swap sRGB for TinyRGB at
the time thumbnails are generated.

JPGs that use another ICC profile than sRGB or no profile at all are
unaffected.

Bug: T100976
Change-Id: I2ae35ddad4e8a82db8b9541974367dc76c884e7a

9 years agoMerge "Remove i18n references to Popularpages"
jenkins-bot [Mon, 22 Jun 2015 14:56:38 +0000 (14:56 +0000)]
Merge "Remove i18n references to Popularpages"

9 years agoMerge "Deprecate jquery.mwExtension"
jenkins-bot [Mon, 22 Jun 2015 13:58:39 +0000 (13:58 +0000)]
Merge "Deprecate jquery.mwExtension"

9 years agoMerge "Remove use of $.escapeRE in favour of mw.RegExp.escape"
jenkins-bot [Mon, 22 Jun 2015 13:58:36 +0000 (13:58 +0000)]
Merge "Remove use of $.escapeRE in favour of mw.RegExp.escape"

9 years agoMerge "Introduce mediawiki.RegExp module"
jenkins-bot [Mon, 22 Jun 2015 13:58:32 +0000 (13:58 +0000)]
Merge "Introduce mediawiki.RegExp module"

9 years agoSet Southern Kurdish to use Kurdish ordered list style type
mjbmr [Mon, 22 Jun 2015 12:29:28 +0000 (12:29 +0000)]
Set Southern Kurdish to use Kurdish ordered list style type

* http://unicode.org/cldr/trac/ticket/8445

Follow-up to I9310a3b4a50c0b8ea6551d9f45e7a2e276a8a389

Change-Id: I6093494c4813b872323bb750cadfc024d6b5ed32

9 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 21 Jun 2015 17:27:55 +0000 (19:27 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I430a6c78fac98611b4a6c31b0a75ec42afeade41

9 years agoChange spaces to tabs
Vivek Ghaisas [Sat, 20 Jun 2015 20:42:40 +0000 (23:42 +0300)]
Change spaces to tabs

Bug: T103243
Change-Id: I145c056ef1b058c9c24b4a402ac9e7778b23e260

9 years agoExplicitly declare property visibility, remove use of var
Vivek Ghaisas [Sat, 20 Jun 2015 21:07:13 +0000 (00:07 +0300)]
Explicitly declare property visibility, remove use of var

Codesniffer says that the `var` keyword must not be used to declare a
property and that visibility must be declared on class properties.

Change-Id: I28240aa0f394588b1df315621dbcd260c51430c1

9 years agotests/phpunit/phpunit.php: Add @codingStandardsIgnore comment
Vivek Ghaisas [Sat, 20 Jun 2015 20:55:06 +0000 (23:55 +0300)]
tests/phpunit/phpunit.php: Add @codingStandardsIgnore comment

MediaWiki Codesniffer warns that "Silencing errors is discouraged".
Assuming this was done with good reason, this patch surrounds the
offending line with comments asking codesniffer to ignore the line.

Ironically, silencing errors about silencing errors.

Change-Id: Ib811b03b0a53735ce0da38bc8861ff38f9d1a666

9 years agomaintenance/exportSites: Fix minor whitespace issue
Vivek Ghaisas [Sat, 20 Jun 2015 20:49:49 +0000 (23:49 +0300)]
maintenance/exportSites: Fix minor whitespace issue

Opening parentheses should be followed by a single space.

Change-Id: I9d73334c3c79bf5277248c56e0f146a91938b35c

9 years agoRestore namespace-number keys in APIQuerySiteinfo siprop=namespaces
This, that and the other [Sat, 20 Jun 2015 12:24:31 +0000 (22:24 +1000)]
Restore namespace-number keys in APIQuerySiteinfo siprop=namespaces

Per discussion at the task.

Bug: T102645
Change-Id: Ic40f7fa3f5612b3d994cc01bcd0929545576041d

9 years agoRemove use of $.escapeRE in favour of mw.RegExp.escape
Timo Tijhof [Sat, 20 Jun 2015 06:17:23 +0000 (07:17 +0100)]
Remove use of $.escapeRE in favour of mw.RegExp.escape

Removes dependency on the generic jquery.mwExtension module I
wrote in 2011 which has rotten and contains largely unused utilities.

Change-Id: Id7025dc2be958840735f4a9a5b020bd876011740

9 years agoDeprecate jquery.mwExtension
Ori Livneh [Sat, 8 Mar 2014 11:36:52 +0000 (03:36 -0800)]
Deprecate jquery.mwExtension

* Deprecating per Krinkle's comment on PS2 of Ie5f0e7d1c.
* No usage in NS_MEDIAWIKI on Wikimedia wikis after these two edits:
  - https://www.mediawiki.org/w/index.php?diff=prev&oldid=923287
  - https://www.mediawiki.org/w/index.php?diff=prev&oldid=923290

Change-Id: Ifb57ae9643bfc652c385b271a73f51577186f2d2

9 years agoIntroduce mediawiki.RegExp module
Timo Tijhof [Sat, 20 Jun 2015 05:46:24 +0000 (06:46 +0100)]
Introduce mediawiki.RegExp module

Simple module based on the $.escapeRE method of the old
"jquery.mwExtension" module.

Change-Id: I9e108a3f8c24d87bb239b63a14807a691c25aa3e

9 years agoresourceloader: Small code cleanups to ResourceLoaderModule
Aaron Schulz [Thu, 18 Jun 2015 20:52:17 +0000 (13:52 -0700)]
resourceloader: Small code cleanups to ResourceLoaderModule

* Changed Exception => LogicException
* Broke some 100 char+ lines

Change-Id: I37bc72065cb567fdd9596f707facc27c6841c434

9 years agoRemove double str_replace( ' ', '_', $ ) when using LinkBatch
umherirrender [Fri, 19 Jun 2015 20:04:25 +0000 (22:04 +0200)]
Remove double str_replace( ' ', '_', $ ) when using LinkBatch

LinkBatch::add already handle the underscore/space part, that means it
is not need to do it on the caller side when adding user names to
LinkBatch

Change-Id: I09e80712903a539164141cc0a88d321203114677

9 years agoAdd LinkBatch to ImagePage for user pages in the file history
umherirrender [Fri, 19 Jun 2015 19:39:50 +0000 (21:39 +0200)]
Add LinkBatch to ImagePage for user pages in the file history

Each user in the file history trigger an own query to get the state of
the user page, talk page and gender information. Use a LinkBatch to
combine all of these queries to two (one for pages, one for gender).

Change-Id: Ic1973c1ccfa17002b343d8c0d110a7c1d20b0460

9 years agoAPI: Change default continuation format for action=query
Brad Jorsch [Sat, 13 Sep 2014 18:03:35 +0000 (14:03 -0400)]
API: Change default continuation format for action=query

The new format is much easier to use correctly, and should therefore be
the default. The old format is maintained for clients that need the
additional flexibility.

Bug: T96858
Change-Id: I984e63581f4ef23ccada916b6d45131d1fb5e001

9 years agoMerge "Fix some line indent of string concat"
jenkins-bot [Fri, 19 Jun 2015 19:10:54 +0000 (19:10 +0000)]
Merge "Fix some line indent of string concat"

9 years agoMerge "Uncomment wfDeprecated call from I6ccd4df"
jenkins-bot [Fri, 19 Jun 2015 19:09:40 +0000 (19:09 +0000)]
Merge "Uncomment wfDeprecated call from I6ccd4df"

9 years agoFix some line indent of string concat
umherirrender [Fri, 19 Jun 2015 18:52:43 +0000 (20:52 +0200)]
Fix some line indent of string concat

Change-Id: I5883c9cd57d106168648b4502051b4b49046fea2

9 years agoMerge "Make constructor of Block accept array of options"
jenkins-bot [Fri, 19 Jun 2015 18:33:20 +0000 (18:33 +0000)]
Merge "Make constructor of Block accept array of options"

9 years agoMerge "Use correct fields for LinkBatch on Special:NewPages"
jenkins-bot [Fri, 19 Jun 2015 18:28:04 +0000 (18:28 +0000)]
Merge "Use correct fields for LinkBatch on Special:NewPages"

9 years agoMerge "Remove unneeded empty lines at begin of if/else/foreach body"
jenkins-bot [Fri, 19 Jun 2015 18:25:57 +0000 (18:25 +0000)]
Merge "Remove unneeded empty lines at begin of if/else/foreach body"

9 years agoUncomment wfDeprecated call from I6ccd4df
Brad Jorsch [Fri, 19 Jun 2015 18:16:18 +0000 (14:16 -0400)]
Uncomment wfDeprecated call from I6ccd4df

It had to be commented in the original patch to make Jenkins happy.

Change-Id: Ifade5231c7b784a8732778a2fcd88668e592522b

9 years agoMake constructor of Block accept array of options
Matěj Grabovský [Thu, 22 May 2014 14:45:46 +0000 (16:45 +0200)]
Make constructor of Block accept array of options

Block::__construct now accepts an array of options instead of a myriad
of optional parameters.

Also add a test for the old constructor.

Change-Id: I6ccd4df569ab49ad841a1ad591e23cafb1715841

9 years agoAvoid undefined index on Special:Tags
umherirrender [Fri, 19 Jun 2015 18:10:41 +0000 (20:10 +0200)]
Avoid undefined index on Special:Tags

An never used tag would not get returned by
ChangeTags::tagUsageStatistics and can raise an undefined index notice:
Undefined index: Test in \includes\specials\SpecialTags.php on line 340

Change-Id: I323f047e20a8f66e381b76d505f3b48123bfdf55

9 years agoRemove unneeded empty lines at begin of if/else/foreach body
umherirrender [Fri, 19 Jun 2015 18:05:45 +0000 (20:05 +0200)]
Remove unneeded empty lines at begin of if/else/foreach body

An if body must not begin with an empty line

Change-Id: I62b058be337fcc85a120fcd3dadce564db59a271

9 years agoFix comment for grep in SpecialWantedfiles.php
umherirrender [Fri, 19 Jun 2015 17:49:04 +0000 (19:49 +0200)]
Fix comment for grep in SpecialWantedfiles.php

Change-Id: Ib8df6c5e1dcb8d8bfd54500ddc6c4e4a37819160

9 years agoUse Linker::linkKnown for some links to MediaWiki pages from navigation
umherirrender [Fri, 19 Jun 2015 16:55:30 +0000 (18:55 +0200)]
Use Linker::linkKnown for some links to MediaWiki pages from navigation

The title used for Linker::link in all places are mediawiki pages, which
are known to be exists (and blue), because there are definied in en.json

Change-Id: Ib3b6e4f4f6cef059a502aaabfcfc17730b4445a6

9 years agoUse correct fields for LinkBatch on Special:NewPages
umherirrender [Fri, 19 Jun 2015 16:04:56 +0000 (18:04 +0200)]
Use correct fields for LinkBatch on Special:NewPages

The special pages is using page_namespace/page_title for the display
title, not rc_namespace/rc_title. Changing this avoids a extra query for
the title when a page was moved and is listed on the special page with
the hint 'rc-old-title'

Change-Id: Ie1e4c9b93c00534543cf75bc3ea2c7e5f8d17460

9 years agoFix tooltip for invert checkbox on Special:NewPages
umherirrender [Fri, 19 Jun 2015 15:45:23 +0000 (17:45 +0200)]
Fix tooltip for invert checkbox on Special:NewPages

Tooltip has to be a 'name', not a parsed message,
because it goes through Linker::getTooltipAndAccessKey

Also propagate tooltip from the checkbox to the label to have a bigger
area for the mouse to trigger the tooltip. This is usally done for other
checkboxes on Special:Watchlist.

Follow-Up: I5c03dc543b910aab27a26a5a223341be50893cf3
Change-Id: If8dd9d66f57f63afe5df02d0d6b4cf70ba5d91c3

9 years agoAdded pre-emptive session renewal to avoid "random" submission errors
Aaron Schulz [Thu, 18 Jun 2015 18:59:12 +0000 (11:59 -0700)]
Added pre-emptive session renewal to avoid "random" submission errors

* The session will be renewed on access if it will expire in 10 minutes
* This avoids a problem both with 532ef78 + PHP <= 5.5 or any PHP >= 5.6

Bug: T102199
Change-Id: I8cad100bc35e86fa95ad144bcad338f3cb5d82a1

9 years agoMerge "resourceloader: Enable module content version for data modules"
jenkins-bot [Thu, 18 Jun 2015 21:19:46 +0000 (21:19 +0000)]
Merge "resourceloader: Enable module content version for data modules"

9 years agoMerge "Avoid assignment in return in TemplateParser.php"
jenkins-bot [Thu, 18 Jun 2015 20:57:08 +0000 (20:57 +0000)]
Merge "Avoid assignment in return in TemplateParser.php"

9 years agoMerge "resourceloader: Use content-neutral context when computing module versions"
jenkins-bot [Thu, 18 Jun 2015 20:43:11 +0000 (20:43 +0000)]
Merge "resourceloader: Use content-neutral context when computing module versions"

9 years agoresourceloader: Enable module content version for data modules
Timo Tijhof [Tue, 2 Jun 2015 17:27:23 +0000 (18:27 +0100)]
resourceloader: Enable module content version for data modules

This greatly simplifies logic required to compute module versions.
It also makes it significantly less error-prone.

Since f37cee996e, we support hashes as versions (instead of timestamps).
This means we can build a hash of the content directly, instead of compiling a
large array with all values that may influence the module content somehow.

Benefits:
* Remove all methods and logic related to querying database and disk for
  timestamps, revision numbers, definition summaries, cache epochs, and more.

* No longer needlessly invalidate cache as a result of no-op changes to
  implementation datails. Due to inclusion of absolute file paths in the
  definition summary, cache was always invalidated when moving wikis to newer
  MediaWiki branches; even if the module observed no actual changes.

* When changes are reverted within a certain period of time, old caches can now
  be re-used. The module would produce the same version hash as before.
  Previously when a change was deployed and then reverted, all web clients (even
  those that never saw the bad version) would have re-fetch modules because the
  version increased.

Updated unit tests to account for the change in version. New default version of
empty test modules is: "mvgTPvXh". For the record, this comes from the base64
encoding of the SHA1 digest of the JSON serialised form of the module content:
> $str = '{"scripts":"","styles":{"css":[]},"messagesBlob":"{}"}';
> echo base64_encode(sha1($str, true));
> FEb3+VuiUm/fOMfod1bjw/te+AQ=

Enabled content versioning for the data modules in MediaWiki core:
* EditToolbarModule
* JqueryMsgModule
* LanguageDataModule
* LanguageNamesModule
* SpecialCharacterDataModule
* UserCSSPrefsModule
* UserDefaultsModule
* UserOptionsModule

The FileModule and base class explicitly disable it for now and keep their
current behaviour of using the definition summary. We may remove it later, but
that requires more performance testing first.

Explicitly disable it in the WikiModule class to avoid breakage when the
default changes.

Ref T98087.

Change-Id: I782df43c50dfcfb7d7592f744e13a3a0430b0dc6

9 years agoFix phpcs warnings
paladox [Mon, 15 Jun 2015 06:35:58 +0000 (06:35 +0000)]
Fix phpcs warnings

Bug: T102614
Change-Id: Iecea365f83bbb0c336b58f1cfdebfc9b1112087e

9 years agoresourceloader: Use content-neutral context when computing module versions
Timo Tijhof [Tue, 16 Jun 2015 03:57:12 +0000 (04:57 +0100)]
resourceloader: Use content-neutral context when computing module versions

The startup module produces a manifest with versions representing the
entire module.

Typically, the request for the startup module itself has only=scripts.
However, that "only" must only apply to what resources of the startup module are
output in the request.

The context passed to getModifiedTime() and getVersionHash() must not suggest
any restriction of measuring only the scripts, or otherwise ignoring some
aspects of the module (such as stylesheets, or messages).

Most existing getModifiedTime() implementations compute timestamps of all
files, regardless of the context. So this bug didn't surface before.
However that will change for modules that compute the version hash based on
getModuleContent(), which does honour the getOnly() and shouldIncludeScripts()
methods of the request context.

Change-Id: Ib8f09c39d10724d146b53b6d53d82da18944a12b

9 years agoAllow limit and offset to be restricted in subclasses of QueryPage.php
daniel [Wed, 17 Jun 2015 15:26:03 +0000 (17:26 +0200)]
Allow limit and offset to be restricted in subclasses of QueryPage.php

Change-Id: Ib54b50619a0f412e53f92d48821221a243f19756

9 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 18 Jun 2015 18:14:01 +0000 (20:14 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ic0490a91badd0a39dfa93d0c51f7417a90e3e845

9 years agoMerge "registration: Improve error message if a non-array attribute is set"
jenkins-bot [Thu, 18 Jun 2015 17:29:15 +0000 (17:29 +0000)]
Merge "registration: Improve error message if a non-array attribute is set"

9 years agoMerge "Use HTMLForm for Special:Export"
jenkins-bot [Thu, 18 Jun 2015 17:20:47 +0000 (17:20 +0000)]
Merge "Use HTMLForm for Special:Export"

9 years agoMerge "Remove unused global from SpecialUserlogin.php"
jenkins-bot [Wed, 17 Jun 2015 22:09:20 +0000 (22:09 +0000)]
Merge "Remove unused global from SpecialUserlogin.php"

9 years agoMerge "Fixed spacing"
jenkins-bot [Wed, 17 Jun 2015 21:40:11 +0000 (21:40 +0000)]
Merge "Fixed spacing"

9 years agoFixed spacing
umherirrender [Wed, 17 Jun 2015 20:01:00 +0000 (22:01 +0200)]
Fixed spacing

- Removed space after casts
- Removed spaces in array index
- Added spaces around string concat
- Added space after words: switch, foreach
- else if -> elseif
- Removed parentheses around require_once, because it is not a function
- Added newline at end of file
- Removed double spaces
- Added spaces around operations
- Removed repeated newlines

Bug: T102609
Change-Id: Ib860222b24f8ad8e9062cd4dc42ec88dc63fb49e

9 years agoAvoid assignment in return in TemplateParser.php
umherirrender [Wed, 17 Jun 2015 20:12:47 +0000 (22:12 +0200)]
Avoid assignment in return in TemplateParser.php

Hard to read and may misread as boolean return

Change-Id: If6bfdbed7e647dde51db62ae6901874a83682d9e

9 years agoFix phpcs warnings
paladox [Mon, 15 Jun 2015 06:35:58 +0000 (06:35 +0000)]
Fix phpcs warnings

Change-Id: I2d7dbf7314257a3ad8f5f6b97a6949a2500d298f

9 years agoMerge "Revert "StashEdit: Use postWithToken""
jenkins-bot [Wed, 17 Jun 2015 20:03:10 +0000 (20:03 +0000)]
Merge "Revert "StashEdit: Use postWithToken""

9 years agoRevert "StashEdit: Use postWithToken"
Ori.livneh [Wed, 17 Jun 2015 19:51:49 +0000 (19:51 +0000)]
Revert "StashEdit: Use postWithToken"

This reverts commit 155ad712c3.

Bug: T102863
Change-Id: Ia30b535a44a3aa4d6e79f14bbccb6f4a1b065aa2

9 years agoRemove unused global from SpecialUserlogin.php
umherirrender [Wed, 17 Jun 2015 19:48:51 +0000 (21:48 +0200)]
Remove unused global from SpecialUserlogin.php

Change-Id: Idbdc8829d84e7dcce6b396bca8f90d9cf7864e45

9 years agoAPI: Give block details along with errors
Alex Monk [Sun, 10 May 2015 14:05:03 +0000 (15:05 +0100)]
API: Give block details along with errors

Bug: T95072
Change-Id: I295d74d5f33e6dd1072a1e85710a02597a46e14d

9 years agoMake a line shorter for phpcs
Amir E. Aharoni [Wed, 17 Jun 2015 15:37:29 +0000 (18:37 +0300)]
Make a line shorter for phpcs

phpcs failure reported at
I30a6af657a11bf822736d667a82b21e813f0db4e

Change-Id: Ia5941684300670e0f232b82393c9af28ce4b972e

9 years agoMerge "Fix ChangeTags functions after split of definedTags from tagUsageStatistics"
jenkins-bot [Wed, 17 Jun 2015 13:58:47 +0000 (13:58 +0000)]
Merge "Fix ChangeTags functions after split of definedTags from tagUsageStatistics"

9 years agoFix ChangeTags functions after split of definedTags from tagUsageStatistics
cenarium [Wed, 17 Jun 2015 13:22:37 +0000 (15:22 +0200)]
Fix ChangeTags functions after split of definedTags from tagUsageStatistics

This provides fixes to the can*Tag functions of ChangeTags following the
removal of listDefinedTags from the tagUsageStatistics function in
I410e9a935bd202faac92f430c0b4dae1a48e2d21.

Change-Id: I087bb7107ae0c83946f8e2f417a6121bb2da18b4

9 years agoFix braces code style
Vivek Ghaisas [Wed, 17 Jun 2015 13:28:51 +0000 (16:28 +0300)]
Fix braces code style

Bug: T102805
Change-Id: I7ce4c71dd605f9be79a630602391271bb269b962

9 years agoRemove multiple empty lines in functions
Vivek Ghaisas [Wed, 17 Jun 2015 10:29:33 +0000 (13:29 +0300)]
Remove multiple empty lines in functions

Functions must not contain multiple empty lines in a row
(Squiz.WhiteSpace.SuperfluousWhitespace sniff).

Bug: T102774
Change-Id: Ib706e4fc34b95c0d7c887e54af0ea61227767d8f

9 years agoMerge "Clarify that gender-unknown option is gender neutral"
jenkins-bot [Wed, 17 Jun 2015 06:15:44 +0000 (06:15 +0000)]
Merge "Clarify that gender-unknown option is gender neutral"

9 years agoMerge "ResourceLoaderImageModule: Fix incorrect documentation"
jenkins-bot [Wed, 17 Jun 2015 03:07:27 +0000 (03:07 +0000)]
Merge "ResourceLoaderImageModule: Fix incorrect documentation"

9 years agoResourceLoaderImageModule: Fix incorrect documentation
Roan Kattouw [Wed, 17 Jun 2015 02:33:59 +0000 (19:33 -0700)]
ResourceLoaderImageModule: Fix incorrect documentation

The docs claimed that you had to do something like
'images' => array( 'filename.svg' => array( 'name' => 'foo' ) )
but what you actually need to do is
'images' => array( 'foo' => array( 'file' => 'filename.svg' ) )

Change-Id: Idca2d5c58e4d9fcf008ef5cfe7f8ce77b996c203

9 years agoUpdate OOjs UI to v0.11.5
James D. Forrester [Wed, 17 Jun 2015 01:07:15 +0000 (18:07 -0700)]
Update OOjs UI to v0.11.5

Release notes:
 https://git.wikimedia.org/blob/oojs%2Fui.git/v0.11.5/History.md

Change-Id: I98bcf928a922e03f7024edaacc9beac95f2b74cf

9 years agoregistration: Improve error message if a non-array attribute is set
Kunal Mehta [Tue, 16 Jun 2015 23:08:44 +0000 (16:08 -0700)]
registration: Improve error message if a non-array attribute is set

Otherwise array_merge_recursive() will trigger a confusing and unhelpful
warning.

Bug: T102523
Change-Id: I7e4778cb7552fe93a08f315c9888ec64322e2501

9 years agoMerge "Don't include never-applied defined tags in tagUsageStatistics function"
jenkins-bot [Tue, 16 Jun 2015 22:41:18 +0000 (22:41 +0000)]
Merge "Don't include never-applied defined tags in tagUsageStatistics function"

9 years agoDon't include never-applied defined tags in tagUsageStatistics function
cenarium [Tue, 16 Jun 2015 19:47:04 +0000 (21:47 +0200)]
Don't include never-applied defined tags in tagUsageStatistics function

This removes the call to ChangeTags::listDefinedTags() in the function
tagUsageStatistics of ChangeTags. So only those in the change_tag table,
i.e. with a hitcount greater than zero, are returned.
Instead at SpecialTags, those tags in the list of defined tags, already
retrieved for other purposes, are appended with zero hitcount, when not
already inserted.
This incidentally makes it easier to get a list of tags applied at least
once, as needed for T27909 (where we don't want never applied tags).

Bug: T91535
Change-Id: I410e9a935bd202faac92f430c0b4dae1a48e2d21

9 years agoMerge "Made User generally use DB_SLAVE by default"
jenkins-bot [Tue, 16 Jun 2015 21:17:43 +0000 (21:17 +0000)]
Merge "Made User generally use DB_SLAVE by default"

9 years agoMerge "Localisation updates from https://translatewiki.net."
Translation updater bot [Tue, 16 Jun 2015 20:15:18 +0000 (20:15 +0000)]
Merge "Localisation updates from https://translatewiki.net."

9 years agoMerge "API: Add some BCarray into ApiQuerySiteinfo"
jenkins-bot [Tue, 16 Jun 2015 20:07:13 +0000 (20:07 +0000)]
Merge "API: Add some BCarray into ApiQuerySiteinfo"