lhc/web/wiklou.git
8 years agoMerge "Convert getMagickVersion() to using APC"
jenkins-bot [Mon, 26 Oct 2015 17:40:25 +0000 (17:40 +0000)]
Merge "Convert getMagickVersion() to using APC"

8 years agoMerge "Make sure, that a tags and input tags with mw-ui-button has the same height"
jenkins-bot [Mon, 26 Oct 2015 17:37:23 +0000 (17:37 +0000)]
Merge "Make sure, that a tags and input tags with mw-ui-button has the same height"

8 years agoMerge "Installer: use _MainCacheType form variable"
jenkins-bot [Mon, 26 Oct 2015 17:32:52 +0000 (17:32 +0000)]
Merge "Installer: use _MainCacheType form variable"

8 years agoMerge "mw.ForeignStructuredUpload: Mark description as being in source wiki's content...
jenkins-bot [Mon, 26 Oct 2015 17:21:59 +0000 (17:21 +0000)]
Merge "mw.ForeignStructuredUpload: Mark description as being in source wiki's content language"

8 years agoInstaller: use _MainCacheType form variable
saper [Fri, 23 Oct 2015 21:29:38 +0000 (23:29 +0200)]
Installer: use _MainCacheType form variable

Do not use "wgMainCacheType" form variable
name that contains values that cannot be
assigned to $wgMainCacheType

Bug: T116375
Change-Id: I83459c8006cc4c1bcdeaa0d78a1230687c95db46

8 years agomw.ForeignStructuredUpload: Mark description as being in source wiki's content language
Bartosz Dziewoński [Mon, 26 Oct 2015 17:08:36 +0000 (18:08 +0100)]
mw.ForeignStructuredUpload: Mark description as being in source wiki's content language

Bug: T116395
Change-Id: Id701ee053be226e9ed1791cbb59459d372ac7255

8 years agoChanged paths to package dependency file
Perside Rosalie [Sun, 25 Oct 2015 23:55:47 +0000 (00:55 +0100)]
Changed paths to package dependency file

Paths to ./composer.lock is changed to ./vendor/composer/installed.json
and dependency information now is read from the installed.json file.
A new ComposerInstalled class has been declared and uses the class now
to access the getInstalledDependencies() method to read data

Bug: T106247
Change-Id: Ic216577bb19b4fc5832ba003fcbbe9195d707b41

8 years agoTitleOptionWidget: Only set grey bg for icons
Ed Sanders [Mon, 26 Oct 2015 14:51:15 +0000 (14:51 +0000)]
TitleOptionWidget: Only set grey bg for icons

When a thumbanil image is used leave the background
transparent, as the thumbnail may have transparency.

Bug: T116588
Change-Id: Id7bd55fcdce337cfcf3f6d9aedc798630e2983c2

8 years agoMerge "Special:Upload Fire wikipage.content hook"
jenkins-bot [Mon, 26 Oct 2015 12:32:57 +0000 (12:32 +0000)]
Merge "Special:Upload Fire wikipage.content hook"

8 years agoConvert getMagickVersion() to using APC
Aaron Schulz [Mon, 26 Oct 2015 08:15:09 +0000 (01:15 -0700)]
Convert getMagickVersion() to using APC

Shelling out on my slow vagrant VM takes about ~3-4ms
so it's probably not worth a  fallback.

Change-Id: Ifd5758264cc15f1ae07972e839a243f5f891503e

8 years agoConvert ForeignApiRepo::httpGetCached() to the WAN cache
Aaron Schulz [Mon, 26 Oct 2015 08:05:08 +0000 (01:05 -0700)]
Convert ForeignApiRepo::httpGetCached() to the WAN cache

Change-Id: I4f1098a6e98570fc4fea6941ffcd64540d6caebd

8 years agoMake DateFormatter::getInstance use APC
Aaron Schulz [Mon, 26 Oct 2015 07:59:10 +0000 (00:59 -0700)]
Make DateFormatter::getInstance use APC

Change-Id: Idfff805903bffcdd6ff8f2a3c1331ca63476933e

8 years agoMerge "Remove unused fields from User"
jenkins-bot [Mon, 26 Oct 2015 07:36:19 +0000 (07:36 +0000)]
Merge "Remove unused fields from User"

8 years agoRemove unused fields from User
Aaron Schulz [Sun, 25 Oct 2015 18:35:33 +0000 (11:35 -0700)]
Remove unused fields from User

Change-Id: Ib209747f1ebd1433969b13b1ecb86d3b57f9be9a

8 years agoMerge "In UploadStash, prioritize core metadata over file handler metadata"
jenkins-bot [Mon, 26 Oct 2015 07:14:54 +0000 (07:14 +0000)]
Merge "In UploadStash, prioritize core metadata over file handler metadata"

8 years agoMerge "clone is not a function"
jenkins-bot [Mon, 26 Oct 2015 07:01:54 +0000 (07:01 +0000)]
Merge "clone is not a function"

8 years agoPreprocessor: Use correct cache prefix for the subclass
Kevin Israel [Mon, 26 Oct 2015 01:29:47 +0000 (21:29 -0400)]
Preprocessor: Use correct cache prefix for the subclass

Follows-up 1559be9f7aef, which caused "Preprocessor" to be used as the
cache prefix for all subclasses, by using late static binding to access
the constant. Though use of that feature has been discouraged[1], this
change is a straightforward bug fix, and any improvements can be made
separately.

[1]: https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#Late_static_binding

Change-Id: Ib25e1908a6373f6675659a0906e12d4a38af014c

8 years agoMerge "Database::__construct(): Don't set $mTrxAtomicLevels to an SplStack"
jenkins-bot [Sun, 25 Oct 2015 23:17:51 +0000 (23:17 +0000)]
Merge "Database::__construct(): Don't set $mTrxAtomicLevels to an SplStack"

8 years agoConsolidate common Preprocessor caching code
Ori Livneh [Thu, 8 Oct 2015 20:54:15 +0000 (13:54 -0700)]
Consolidate common Preprocessor caching code

* Consolidate nearly-identical caching code in Preprocessor_DOM and
  Preprocessor_Hash by making Preprocessor an abstract class rather than an
  interface and by implementing Preprocessor::cacheSetTree() and
  Preprocessor::cacheGetTree().
* Cache trees for wikitext blobs that have length equal or greater to
  PreprocessorCacheThreshold. Previously they needed to be greater than
  PreprocessorCacheThreshold, so this changes the requirement by one character.
  I did it because it seems more natural.
* Modernize the code to use singleton service objects rather than globals.

We spend a lot of time in the Preprocessor, so it would be nice for this code
to be well-factored and clear.

Change-Id: Ib71c29f14a28445a505e12c774a24ad964330b95

8 years agoDatabase::__construct(): Don't set $mTrxAtomicLevels to an SplStack
Kevin Israel [Sun, 25 Oct 2015 23:02:15 +0000 (19:02 -0400)]
Database::__construct(): Don't set $mTrxAtomicLevels to an SplStack

Follows-up db0b9ef2649c and 01ef30fcc495.

Change-Id: I06188c746fb885819aa93e0e3caf3dc2bac7ae72

8 years agoMerge "Update CACHE_MEMCACHED to not used newMemcached"
jenkins-bot [Sun, 25 Oct 2015 21:33:04 +0000 (21:33 +0000)]
Merge "Update CACHE_MEMCACHED to not used newMemcached"

8 years agoSpecial:Upload Fire wikipage.content hook
Derk-Jan Hartman [Sun, 25 Oct 2015 19:25:08 +0000 (20:25 +0100)]
Special:Upload Fire wikipage.content hook

The warning here is a fragment of wikicode, and can include the video
player for instance.

Bug: T51751
Change-Id: I45e10f5f5700ea7c526a63b4f47a21d630c6d8ee

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 25 Oct 2015 20:48:12 +0000 (21:48 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I82484aa5a52137eadc2cae6a7355fef38f089977

8 years agoMerge "installer: Remove additional newline in LocalSettings.php"
jenkins-bot [Sun, 25 Oct 2015 20:33:04 +0000 (20:33 +0000)]
Merge "installer: Remove additional newline in LocalSettings.php"

8 years agoinstaller: Remove additional newline in LocalSettings.php
saper [Fri, 23 Oct 2015 20:09:04 +0000 (22:09 +0200)]
installer: Remove additional newline in LocalSettings.php

Change-Id: I6a0630d109c0ab4299507d125e4e1748055bcd58

8 years agoMerge "Cleanup on Special:AllPages and Special:PrefixIndex"
jenkins-bot [Sun, 25 Oct 2015 18:41:56 +0000 (18:41 +0000)]
Merge "Cleanup on Special:AllPages and Special:PrefixIndex"

8 years agoUpdate CACHE_MEMCACHED to not used newMemcached
Aaron Schulz [Sun, 25 Oct 2015 18:24:16 +0000 (11:24 -0700)]
Update CACHE_MEMCACHED to not used newMemcached

* Follow up to 0dd27b1da9e45
* Also removed that method, which is not used by callers

Bug: T116541
Change-Id: Ic6e4e25089de112cfd263fb042d654ee06970859

8 years agoIn UploadStash, prioritize core metadata over file handler metadata
Brian Wolff [Sat, 24 Oct 2015 18:15:26 +0000 (12:15 -0600)]
In UploadStash, prioritize core metadata over file handler metadata

If us_props is too big for the database (> 64kb), don't store the
file handler metadata. This is usually by far the biggest portion
(For pdf/djvu it contains OCR data), and it's non-critical to the
upload process as it's only needed for display, and the file handler
will probably regenerate it anyway if it is missing.

At some point in the future, having data too big for a db field
is probably going to cause errors instead of silent truncation,
so we really don't want to be doing silent truncation.

An alternative way to solve T94562 might be to make it use us_sha1
instead of the one encoded in us_props, but seems like it's important
to fix us_props for other data in it too.

Bug: T94562
Change-Id: I8aed6a1a5c9a136090b36d4ad23d8429791f58c4

8 years agoMerge "Use the new 'difftotextpst' option of prop=revisions API in live preview script"
jenkins-bot [Sun, 25 Oct 2015 11:50:09 +0000 (11:50 +0000)]
Merge "Use the new 'difftotextpst' option of prop=revisions API in live preview script"

8 years agoUse the new 'difftotextpst' option of prop=revisions API in live preview script
Matt Russell [Wed, 21 Oct 2015 15:08:34 +0000 (02:08 +1100)]
Use the new 'difftotextpst' option of prop=revisions API in live preview script

This should improve the diff performance on large pages by a fair amount,
especially on slow connections, as you now just upload the page content once
and then download the diff, rather than having to upload the page content,
download the PST'd page content, re-upload the PST'd page content, and then
finally download the diff.

If there is a summary, the parse request is still performed with just the summary
text, but it is done in parallel to the diff request, and will likely finish
before the diff request anyway, so won't impact the diff performance.
A further improvement could be potentially made, by not sending a summary parse
request when the summary is plain text. This would be fairly easy to detect
(assuming extensions can't modify what is parsed in a summary), just
look for "[[" and "/*".

Also improves the error handling to show errors occurring on the diff request.

Bug: T116178
Change-Id: Ic81bad25ccc8b96c862feb31b7dedd80d1507eeb

8 years agoMerge "Remove paranoid title check from RefreshLinksJob::runForTitle"
jenkins-bot [Sun, 25 Oct 2015 07:12:41 +0000 (07:12 +0000)]
Merge "Remove paranoid title check from RefreshLinksJob::runForTitle"

8 years agoMerge "Install link to Manual:Combating_spam on the home page"
jenkins-bot [Sun, 25 Oct 2015 07:02:05 +0000 (07:02 +0000)]
Merge "Install link to Manual:Combating_spam on the home page"

8 years agoMeasure commitMasterChanges() run time
Aaron Schulz [Sun, 25 Oct 2015 03:59:25 +0000 (20:59 -0700)]
Measure commitMasterChanges() run time

Change-Id: Icf36ce5bc5b6997aec1b43e5d271ad196ab7bcb6

8 years agoProtect WAN cache sets() against uncommitted data
Aaron Schulz [Wed, 21 Oct 2015 05:55:51 +0000 (22:55 -0700)]
Protect WAN cache sets() against uncommitted data

This generally only effects wikis with no slave DBs,
but also matters if the master has non-zero LB load.
If the master ends up being used for DB_SLAVE, care
should be shown for cache-aside writes

Interesting WAN cache events are now logged.

Change-Id: I2cd8e84138263c13ea23beb9ab3d7562340e1fd3

8 years agoObjectFactory: avoid using ReflectionClass
Bryan Davis [Sat, 24 Oct 2015 18:42:07 +0000 (12:42 -0600)]
ObjectFactory: avoid using ReflectionClass

Add a new ObjectFactory::constructClassInstance() method that uses
a loop unrolling type of technique to avoid using ReflectionClass when
creating new class instances with 10 or fewer constructor arguments.

I really wanted to also include the use of PHP 5.6's `...` splat
operator when supported but there is no way to conditionally use a new
operator in a way that still allows older versions of PHP to parse the
same source file.

Bug: T115729
Change-Id: Ia29c4526f4bac51696654c9b0677cb3f70359966

8 years agoMerge "Fix bogus calls to encodeKey/decodeKey in the PHP memcached class"
jenkins-bot [Sat, 24 Oct 2015 23:39:50 +0000 (23:39 +0000)]
Merge "Fix bogus calls to encodeKey/decodeKey in the PHP memcached class"

8 years agoobjectcache: Remove outdated comment about back-compat defaults
Timo Tijhof [Sat, 24 Oct 2015 22:41:44 +0000 (23:41 +0100)]
objectcache: Remove outdated comment about back-compat defaults

Follows-up 0dd27b1da9e.

Change-Id: Ic21b02d93d6047eb4713dfec3cbb2fff4d51fdff

8 years agoFix bogus calls to encodeKey/decodeKey in the PHP memcached class
Aaron Schulz [Sat, 24 Oct 2015 22:16:59 +0000 (15:16 -0700)]
Fix bogus calls to encodeKey/decodeKey in the PHP memcached class

* Follow up to cdb543272883b180
* These are no longer needed

Change-Id: Id41c3aae50a13f3c53f2bbd9662027b36a1f4142

8 years agoMerge "Move some memcached classes to /libs"
Aaron Schulz [Sat, 24 Oct 2015 22:36:43 +0000 (22:36 +0000)]
Merge "Move some memcached classes to /libs"

8 years agoMove some memcached classes to /libs
Aaron Schulz [Sat, 24 Oct 2015 21:54:10 +0000 (14:54 -0700)]
Move some memcached classes to /libs

Also removed a few MW dependencies from MemcachedPeclBagOStuff.
It still uses an IP class method, so it has to stay for now.

Change-Id: I8c5c83046c58fb58091d6ce11b2385208262460f

8 years agoValidate status codes returned from the AbortLogin hook
Gergő Tisza [Mon, 17 Aug 2015 23:08:00 +0000 (23:08 +0000)]
Validate status codes returned from the AbortLogin hook

In case of a return value which is not in LoginForm::$statusCodes,
this results in a nicer error message instead of an array access error.

Bug: T109193
Change-Id: I64c955327c7dfc64807fa83d30538f3da66618bc

8 years agoMerge "Remove some MW dependencies from RedisConnectionPool"
jenkins-bot [Sat, 24 Oct 2015 22:24:58 +0000 (22:24 +0000)]
Merge "Remove some MW dependencies from RedisConnectionPool"

8 years agoMove MemcachedBagOStuff b/c logic to ObjectCache
Aaron Schulz [Sat, 24 Oct 2015 21:47:19 +0000 (14:47 -0700)]
Move MemcachedBagOStuff b/c logic to ObjectCache

Change-Id: Iedb173b00d543237b3e7560b8079b8d488e00d80

8 years agoRemove some MW dependencies from RedisConnectionPool
Aaron Schulz [Sat, 24 Oct 2015 22:06:24 +0000 (15:06 -0700)]
Remove some MW dependencies from RedisConnectionPool

Change-Id: I41ee08d8c6df14ef5994ea8dd2ee61eb220941e3

8 years agoMerge "Make DBReadOnlyError extend DBExpectedError"
jenkins-bot [Sat, 24 Oct 2015 20:46:03 +0000 (20:46 +0000)]
Merge "Make DBReadOnlyError extend DBExpectedError"

8 years agoMerge "Move MultiWriteBagOStuff to /libs"
jenkins-bot [Sat, 24 Oct 2015 20:22:51 +0000 (20:22 +0000)]
Merge "Move MultiWriteBagOStuff to /libs"

8 years agoMake DBReadOnlyError extend DBExpectedError
Aaron Schulz [Sat, 24 Oct 2015 20:13:01 +0000 (13:13 -0700)]
Make DBReadOnlyError extend DBExpectedError

This makes the output formatting a bit prettier

Change-Id: I5d5c5a421326029323ef367feac70179ecb2d9e1

8 years agoMove MultiWriteBagOStuff to /libs
Aaron Schulz [Sat, 24 Oct 2015 07:48:40 +0000 (00:48 -0700)]
Move MultiWriteBagOStuff to /libs

Also moved related tests files to /libs.

Change-Id: I806eeaa30205733d497adde933baf0c4157f7aae

8 years agoMake sure, that a tags and input tags with mw-ui-button has the same height
Florian [Sat, 24 Oct 2015 18:34:53 +0000 (20:34 +0200)]
Make sure, that a tags and input tags with mw-ui-button has the same height

Line-height inherited from another element behave different for input and a
tags. While a-tags correctly inherit the line-height from a parent element,
input tags doesn't. Fix that by adding the correct line-height (normal) to
a tags with mw-ui-button.

Bug: T116427
Change-Id: I4822754157b95094605209111e72bce11d34b077

8 years agoUpdate grunt-jsonlint to 1.0.5
Paladox [Sat, 24 Oct 2015 14:55:55 +0000 (15:55 +0100)]
Update grunt-jsonlint to 1.0.5

This is a minor update there were packages updates in this version.

Change-Id: I43cced8c20153d06f764ebba90f64de0431e2d3f

8 years agoMerge "Minor fix to primeFileCache() comment"
jenkins-bot [Sat, 24 Oct 2015 07:43:17 +0000 (07:43 +0000)]
Merge "Minor fix to primeFileCache() comment"

8 years agoEnforce stricter slave lag limits for bot API requests
Aaron Schulz [Fri, 2 Oct 2015 00:57:07 +0000 (17:57 -0700)]
Enforce stricter slave lag limits for bot API requests

* All users with the bot right sending requests to
  write APIs will get a read-only error when slave
  lag is high. The lag tolerance is configured via
  $wgAPIMaxLagThreshold.
* Making this lower than 'max lag' in the LBFactory
  config means bots get read-only errors before other
  users, which is sensible.
* The default LoadBalancer 'max lag' is now 10 instead
  of 30, which now matches the timeout used for waiting
  on MASTER_POS_WAIT() for ChronologyProtector. This is
  better for assuring that users see their own changes.

Bug: T95501
Change-Id: If9d8f4ef47258d5afb7a0e947c6e6f040cbc7e10

8 years agoMerge "Provide some default $wgRateLimits values"
jenkins-bot [Sat, 24 Oct 2015 07:28:11 +0000 (07:28 +0000)]
Merge "Provide some default $wgRateLimits values"

8 years agoProvide some default $wgRateLimits values
Aaron Schulz [Thu, 22 Oct 2015 04:52:52 +0000 (21:52 -0700)]
Provide some default $wgRateLimits values

* This provides some minimal out-of-the-box protection.
* These mostly are the values used by WMF in mediawiki-config

Change-Id: Ie510ca9314e151f9c0ad0705d096fe2bb749a59d

8 years agoMerge "Fixes to MemcachedBagOStuff::makeKeyInternal()"
Aaron Schulz [Sat, 24 Oct 2015 05:44:05 +0000 (05:44 +0000)]
Merge "Fixes to MemcachedBagOStuff::makeKeyInternal()"

8 years agoAdd wfWaitForSlaves() to HTMLCacheUpdateJob
Aaron Schulz [Sat, 24 Oct 2015 05:24:48 +0000 (22:24 -0700)]
Add wfWaitForSlaves() to HTMLCacheUpdateJob

Change-Id: Iabf3d01f15b36bcb51e7fd8512404df2a3aedf35

8 years agoFixes to MemcachedBagOStuff::makeKeyInternal()
Aaron Schulz [Sat, 24 Oct 2015 04:03:11 +0000 (21:03 -0700)]
Fixes to MemcachedBagOStuff::makeKeyInternal()

* Follow-up to 0c9fb12265e2
* Make sure colons actually get escaped
* Added more unit tests
* Also fixed the test actual/expected order

Change-Id: Ie04ea6059ee1eb6d1da8f30fefdec52fa49d38fb

8 years agoMerge "Web installer should not pollute global namespace with session variables"
jenkins-bot [Sat, 24 Oct 2015 04:38:46 +0000 (04:38 +0000)]
Merge "Web installer should not pollute global namespace with session variables"

8 years agoRemove paranoid title check from RefreshLinksJob::runForTitle
Aaron Schulz [Sat, 24 Oct 2015 04:14:11 +0000 (21:14 -0700)]
Remove paranoid title check from RefreshLinksJob::runForTitle

Change-Id: Ie2b875dcb394e9cf20818a26d245684933765baf

8 years agoEscape colons in BagOStuff key segments
Ori Livneh [Fri, 23 Oct 2015 22:12:51 +0000 (15:12 -0700)]
Escape colons in BagOStuff key segments

For the sake of safety and correctness, the following BagOStuff::makeKey()
invocations should return distinct keys:

   $cache->makeKey( 'ab:', 'cd' );
   $cache->makeKey( 'ab', ':cd' );

That is not currently the case, because while we use ':' as a key path
separator, we don't escape ':' in the input supplied to makeKey(). So, make
BagOStuff::makeKeyInternal() URL-encode colons.

To prevent this from messing up the max. key length calculations, reproduce
this logic in MemcachedBagOStuff::makeKeyInternal(), in lieu of having the
method call its parent.

Change-Id: I83ea7e7336a1c9e64aa42284c2517089a736efe5

8 years agoEnsure all key transformations are applied by BagOStuff::makeKeyInternal()
Ori Livneh [Sat, 24 Oct 2015 00:53:25 +0000 (17:53 -0700)]
Ensure all key transformations are applied by BagOStuff::makeKeyInternal()

Currently we have to undo any transformations we apply to keys in getMulti() by
iterating over the response array keys reversing any changes. This is hairy and
complicated. So --

* Replace calls to MemcachedBagOStuff::encodeKey() with calls to a new method,
  MemcachedBagOStuff::validateKeyEncoding(). The new method only validates that
  the key is compatible with memcached. If it is not, it throws an exception.
  If it is, it returns the key unmodified.

* Remove MemcachedBagOStuff::{encode,decode}Key(), since they no longer serve a
  purpose, and have no callers.

Change-Id: If3e20c6a1a1b42fc1f2823aa660328e37c26eccb

8 years agoMinor fix to primeFileCache() comment
Aaron Schulz [Sat, 24 Oct 2015 00:18:56 +0000 (17:18 -0700)]
Minor fix to primeFileCache() comment

Change-Id: I7d040c5a914574df72fa31612df0eb28e15fd46c

8 years agoFixes related to WikiPage::triggerOpportunisticLinksUpdate()
Aaron Schulz [Fri, 23 Oct 2015 18:48:50 +0000 (11:48 -0700)]
Fixes related to WikiPage::triggerOpportunisticLinksUpdate()

* Focus on updating links that would *not* already be updated
  by jobs, not those that already *will* be updated.
* Place the jobs into a dedicated queue so they don't wait
  behind jobs that actually have to parse every time. This
  helps avoid queue buildup.
* Make Job::factory() set the command field to match the value
  it had when enqueued. This makes it easier to have the same
  job class used for multiple queues.
* Given the above, remove the RefreshLinksJob 'prioritize' flag.
  This worked by overriding getType() so that the job went to a
  different queue. This required both the special type *and* the
  flag to be set if using JobSpecification or either ack() would
  route to the wrong queue and fail or the job would go in the
  regular queue. This was too messy and error prone. Cirrus jobs
  using the same pattern also had ack() failures for example.

Change-Id: I5941cb62cdafde203fdee7e106894322ba87b48a

8 years agoWeb installer should not pollute global namespace with session variables
saper [Fri, 23 Oct 2015 20:54:42 +0000 (22:54 +0200)]
Web installer should not pollute global namespace with session variables

There is no need to store session variables
(that also include user-supplied arguments)
as $wgXXX global variables.

Bug: T116375
Change-Id: I880d4299566beaf99ed1fc21c690cdda64149b0e

8 years agoMerge "Improve normalization and sanitization of memcached keys"
jenkins-bot [Fri, 23 Oct 2015 23:36:29 +0000 (23:36 +0000)]
Merge "Improve normalization and sanitization of memcached keys"

8 years agoInstall link to Manual:Combating_spam on the home page
saper [Fri, 23 Oct 2015 23:23:18 +0000 (01:23 +0200)]
Install link to Manual:Combating_spam on the home page

Bug: T85327
Change-Id: I2bfe8b1489f748df2d24946d7c49b97d5cbf921e

8 years agoImprove normalization and sanitization of memcached keys
Ori Livneh [Fri, 23 Oct 2015 18:10:10 +0000 (11:10 -0700)]
Improve normalization and sanitization of memcached keys

The motivation for this patch came from seeing the following error in the
memcached log:

  memcached ERROR: Memcached error for key "flowdb:flow_ref:wiki:by-source:\
   v3:0:tawikinews:பூமிக்கு_அச்சுறுத்தலான_சிறுகோள்களைக்_கண்டுபிடிக்கும்_முயற்சியில்_தனியார்_நிறுவன0jம்:4.7" \
   on server ":": A BAD KEY WAS PROVIDED/CHARACTERS OUT OF RANGE

I submitted a fix to Flow in I26e531f6, but I noticed that AbuseFilter had a
similar issue (fixed by Aaron in I27b51a4b), so I started thinking about how
to solve this more generally:

* The regular expression we current use to sanitize keys does not cover
  characters outside the ASCII range, but such characters can be illegal
  if one of their constituent bytes (when taken by itself) is an ASCII
  control character. So change the regular expression to cover any and all
  characters that fall outside the range \x22-\x7e (and '#' -- see below).

* Enforce a key length limit of 255 bytes, which is the maximum length
  permitted by the memcached protocol. The Tamil segment in the key above is 84
  characters, but 233 bytes in UTF-8, which become 684 characters when
  URL-encoded. To fix this, try to shrink any segment that would push the total
  key length over the limit by md5()ing it. If the end result is *still* over
  the limit (this would happen if, for example, $args consists of many short
  strings), then concatenate all args together and MD5 them.

* MD5'd arguments are prefixed with '#'. Any "organic" '#'s in the key segments
  are URL-encoded.

Change-Id: Ia46987d3b0a09bb6b1952abd936d4c72ea7c56a0

8 years agoMerge "installer: Define $wgResourceBasePath in LocalSettings.php"
jenkins-bot [Fri, 23 Oct 2015 22:16:20 +0000 (22:16 +0000)]
Merge "installer: Define $wgResourceBasePath in LocalSettings.php"

8 years agoMerge "poolcounter: Add 'trigger' field to the slow-parse log"
jenkins-bot [Fri, 23 Oct 2015 22:02:01 +0000 (22:02 +0000)]
Merge "poolcounter: Add 'trigger' field to the slow-parse log"

8 years agoinstaller: Define $wgResourceBasePath in LocalSettings.php
saper [Fri, 23 Oct 2015 12:40:00 +0000 (14:40 +0200)]
installer: Define $wgResourceBasePath in LocalSettings.php

Bug: T116374
Bug: T75031
Change-Id: I459c1097ed7048c3fe24e636e9ea22ec2e3b2675

8 years agopoolcounter: Add 'trigger' field to the slow-parse log
Timo Tijhof [Fri, 23 Oct 2015 18:33:52 +0000 (19:33 +0100)]
poolcounter: Add 'trigger' field to the slow-parse log

To better indicate that these are only triggered by page views.

We don't currently have any slow-parse logging for the parser
invocation that happens during save (which means we're potentially
missing lots of them).

Once we add that, this will help distinguish them.

Bug: T110760
Change-Id: I22be5684ef93efd410d683637e223f770d6c768c

8 years agoMerge "Remove buggy b/c logic in Parser::disableCache()/updateCacheExpiry()"
jenkins-bot [Fri, 23 Oct 2015 20:30:20 +0000 (20:30 +0000)]
Merge "Remove buggy b/c logic in Parser::disableCache()/updateCacheExpiry()"

8 years agoRemove buggy b/c logic in Parser::disableCache()/updateCacheExpiry()
Aaron Schulz [Fri, 23 Oct 2015 19:35:43 +0000 (12:35 -0700)]
Remove buggy b/c logic in Parser::disableCache()/updateCacheExpiry()

* Setting mCacheTime to -1 is for old callers that
  only check getCacheTime() instead of getCacheExpiry().
  Most of them are already broken (WikiLog/SemanticForms) as
  they check for -1 which is in fact never returned
  due to the TS_MW conversion in Parser::getCacheTime.
* By using -1, the value of page_links_updated can end up
  as 1969, which is confusing and broken.

Change-Id: I8809a4258eacff05992a2c27ade7f6a0c1731c51

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 23 Oct 2015 19:27:57 +0000 (21:27 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ia0a10443f264e238e6136edbb2bb60dd9ddd1c96

8 years agoMerge "Setup.php: Remove incorrect comment"
jenkins-bot [Fri, 23 Oct 2015 19:04:53 +0000 (19:04 +0000)]
Merge "Setup.php: Remove incorrect comment"

8 years agoSetup.php: Remove incorrect comment
Bartosz Dziewoński [Fri, 23 Oct 2015 18:50:11 +0000 (20:50 +0200)]
Setup.php: Remove incorrect comment

This is not true since $wgSkinExtensionFunctions was removed in r87487.

Change-Id: Ia2c75aa191516fa43272ed51789579cf7afd9e37

8 years agoThrow Exceptions on preg_* failures in MagicWordArray::matchAndRemove()
Kunal Mehta [Thu, 15 Oct 2015 18:37:38 +0000 (11:37 -0700)]
Throw Exceptions on preg_* failures in MagicWordArray::matchAndRemove()

There are a lot of other cases in this file alone that need to be fixed
(e.g. (bool)preg_match), but those should be fixed in a more systematic
way like a wrapper function.

Bug: T115514
Change-Id: I3840a56adc0a6e50963b930051892491f8e90245

8 years agoMerge "Move CAPTCHA messages into ConfirmEdit and update class names"
jenkins-bot [Fri, 23 Oct 2015 15:36:30 +0000 (15:36 +0000)]
Merge "Move CAPTCHA messages into ConfirmEdit and update class names"

8 years agomediawiki.notification.css: Avoid horizontal scrollbar on fade in and fade out
Fomafix [Fri, 23 Oct 2015 12:24:15 +0000 (12:24 +0000)]
mediawiki.notification.css: Avoid horizontal scrollbar on fade in and fade out

This is a follow-up to I01473a199665b9fd86ed50b7d117532ac94f3edf.

Change-Id: I596927bfca0efd52db8d46eeea9ba38c7a9f7ca5

8 years agoMerge "ApiQueryAllRevisions: Actually use 'start' and 'end'"
jenkins-bot [Fri, 23 Oct 2015 07:44:45 +0000 (07:44 +0000)]
Merge "ApiQueryAllRevisions: Actually use 'start' and 'end'"

8 years agomediawiki.notification: Use CSS tranforms for in/out animations
Timo Tijhof [Fri, 25 Sep 2015 15:15:58 +0000 (16:15 +0100)]
mediawiki.notification: Use CSS tranforms for in/out animations

Remove the whole placeholder system. This was needed to preserve
parking space while visually animating the element elsewhere.
CSS transforms have this behaviour naturally.

Change-Id: I01473a199665b9fd86ed50b7d117532ac94f3edf

8 years agoReduce DBPerformance warning spam for jobs a bit
Aaron Schulz [Fri, 23 Oct 2015 03:40:57 +0000 (20:40 -0700)]
Reduce DBPerformance warning spam for jobs a bit

Change-Id: I1c5fdae6e0f98fff5f3336d8a46a4b3ff25d5bad

8 years agoMerge "Bound BagOStuff::lock() RTT estimate for sanity"
jenkins-bot [Fri, 23 Oct 2015 01:43:28 +0000 (01:43 +0000)]
Merge "Bound BagOStuff::lock() RTT estimate for sanity"

8 years agoMerge "Make TransactionProfiler show the actual query times"
jenkins-bot [Fri, 23 Oct 2015 01:32:00 +0000 (01:32 +0000)]
Merge "Make TransactionProfiler show the actual query times"

8 years agoMerge "Fix ChangeTag "lockTSE" values as INF does not actually work"
jenkins-bot [Thu, 22 Oct 2015 21:40:44 +0000 (21:40 +0000)]
Merge "Fix ChangeTag "lockTSE" values as INF does not actually work"

8 years agoDisplaying search results for multiple wikis
Stanislav Malyshev [Fri, 18 Sep 2015 19:30:30 +0000 (12:30 -0700)]
Displaying search results for multiple wikis

Uses fully translated string like search-interwiki-results-abwiki
which should be present in WikimediaMessages.

Requires Ic4bdd9462f844febea2e402e4b89d9dcc4c836b6
Supports I0d0efacf3066b3b5fe0bfcb058dd0b0f9988ccae

Bug: T112349
Change-Id: Ib6524bc79e1648ccf6adc5745f0dbc4c26dcb0d2

8 years agoMerge "Revert "mediawiki.Upload.BookletLayout: If the user can't upload, don't show...
jenkins-bot [Thu, 22 Oct 2015 21:31:12 +0000 (21:31 +0000)]
Merge "Revert "mediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form""

8 years agoUse ImportStringSource for simple import sources
saper [Fri, 14 Nov 2014 00:56:47 +0000 (01:56 +0100)]
Use ImportStringSource for simple import sources

Bug: T75283
Change-Id: I61c94202467ae6729ae52684a6477f7cbd8e00b7

8 years agoRevert "mediawiki.Upload.BookletLayout: If the user can't upload, don't show them...
Bartosz Dziewoński [Thu, 22 Oct 2015 21:20:50 +0000 (21:20 +0000)]
Revert "mediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form"

This actually won't work for Wikimedia wikis, turns out
that many of them disabled local uploads.

This reverts commit 29edb68446b5b6faa4b5038698f042ef25e4425d.

Bug: T115866
Change-Id: Ib28539f2ff22cdbf1d80b1b601e7855c1110ad40

8 years agoMerge "mediawiki.Upload.BookletLayout: If the user can't upload, don't show them...
jenkins-bot [Thu, 22 Oct 2015 21:10:38 +0000 (21:10 +0000)]
Merge "mediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form"

8 years agoMerge "Make LinksUpdate::__construct() use normal type hints"
jenkins-bot [Thu, 22 Oct 2015 21:10:34 +0000 (21:10 +0000)]
Merge "Make LinksUpdate::__construct() use normal type hints"

8 years agoFix ChangeTag "lockTSE" values as INF does not actually work
Aaron Schulz [Thu, 22 Oct 2015 21:00:06 +0000 (14:00 -0700)]
Fix ChangeTag "lockTSE" values as INF does not actually work

Change-Id: If6c6b034be60ffc8b22b67cef12e5d701a871788

8 years agoMerge "Properly make LinksUpdate be recursive when done from job queue"
jenkins-bot [Thu, 22 Oct 2015 20:46:00 +0000 (20:46 +0000)]
Merge "Properly make LinksUpdate be recursive when done from job queue"

8 years agoMake LinksUpdate::__construct() use normal type hints
Aaron Schulz [Thu, 22 Oct 2015 20:25:49 +0000 (13:25 -0700)]
Make LinksUpdate::__construct() use normal type hints

Change-Id: Ie5f4de95d07ac9f24e415f92c5116385863a47f9

8 years agomediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form
Bartosz Dziewoński [Thu, 22 Oct 2015 19:25:32 +0000 (21:25 +0200)]
mediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form

To improve in the future:
* Check the rights on the target wiki rather than current, they might
  not be the same
* Use a better error message when not all logged-in users can upload

Bug: T115866
Change-Id: I6f68122b5399f4b8766825c752e964478ae7563d

8 years agoProperly make LinksUpdate be recursive when done from job queue
Brian Wolff [Thu, 22 Oct 2015 18:56:03 +0000 (12:56 -0600)]
Properly make LinksUpdate be recursive when done from job queue

New enqueue method of DeferredUpdates was turning LinksUpdate
updates into Jobs. However RefreshLinksJob was not properly
reconstructing the secondary updates as being recursive (if they
were recursive). This means that templates weren't having the pages
that were using them being updated.

See also related T116001.

Change-Id: Ia06246efb2034fdfe07232fd8c2334160edbcf02

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 22 Oct 2015 18:46:05 +0000 (20:46 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I7830f3ff793b90c23a08fa3496a7178c127cd605

8 years agoCleanup on Special:AllPages and Special:PrefixIndex
Glaisher [Mon, 19 Oct 2015 18:00:44 +0000 (23:00 +0500)]
Cleanup on Special:AllPages and Special:PrefixIndex

* Move pagination links to the left (on LTR) and below the form
* Drop a few HTML classes
* Minor code cleanups
* Remove Allpages link from Special:Allpages pagination links

Follows up I720d34e21950c18de3c6e0b1d6d8a4461db495cb

Bug: T32965
Change-Id: I19018d87b769320761a95410bb3198b31f16544d

8 years agoMove CAPTCHA messages into ConfirmEdit and update class names
Matthew Flaschen [Thu, 22 Oct 2015 14:49:09 +0000 (10:49 -0400)]
Move CAPTCHA messages into ConfirmEdit and update class names

Depends on I0e55a159efd66a73cd217d9a5e86b2bced90f57a in ConfirmEdit .
This should be merged just after that.

Also, remove a dead config variable.

This leaves only the CAPTCHA stuff that is actually specific
to CreateAccount.

Change-Id: I8924d537cad3e39adace99fb20626247128d9bd9

8 years agoMove Special:PageLanguage to the pagetools group on Special:SpecialPages
umherirrender [Fri, 16 Oct 2015 14:02:01 +0000 (16:02 +0200)]
Move Special:PageLanguage to the pagetools group on Special:SpecialPages

Acting on pages, so that group is better than the default of "other"

Change-Id: I50c993d69048eeee913fbab513711018999aafe9