mediawiki.git
8 years agoReady RC11.22.0rc1
Mark A. Hershberger [Sat, 9 Nov 2013 02:33:38 +0000 (8 21:33 -0500)]
Ready RC1
* Rearrange release notes
* Bump version

Change-Id: Iaf209f596185a8168118395d4e9ca58ea3bdc180

8 years agoCorrect tooltip of "Next n results" on query special pages.
Alexandre Emsenhuber [Fri, 8 Nov 2013 17:45:42 +0000 (8 18:45 +0100)]
Correct tooltip of "Next n results" on query special pages.

Was showing "Previous n results".

Bug: 56707
Change-Id: I9f51d70f9e1fe3c314a1226950f1324ab22f4199

8 years agoFix call to function applyPatch in MysqlUpdater
umherirrender [Tue, 5 Nov 2013 18:58:13 +0000 (5 19:58 +0100)]
Fix call to function applyPatch in MysqlUpdater

Change-Id: Ieefc8968ae3d397482df939e5d1ccd15df0c4705
(cherry picked from commit 1db6a5925b65590421fa1a9ec30902195d51e264)

8 years agoMake it possible to install extensions using Composer
jeroendedauw [Thu, 31 Oct 2013 23:37:10 +0000 (1 00:37 +0100)]
Make it possible to install extensions using Composer

With this change it is possible for users to create a composer.json
file in which they list the extensions they want to have installed
and then install them via Composer. They can copy composer-example.json
to get started.

Before this change there was an actual composer.json file tracked by
git, so people would get a change tracked by git if they modified it.

Surprisingly this is all that is needed to get extension installation
to work, for the extensions that already support it. Kudos to hashar
and others that already did the other required work.

With this change core no longer pretends to be a component that is
installable via composer. This never worked, and core will need to
be modified in several ways before this can work. In other words,
no working functionality is lost, and quite a lot is gained.

Example usage:

* Copy composer-example.json to composer.json.
* Run "composer require diff/diff 0.9"
* Hit Special:Version and be happy

Change-Id: Ib125bea00cd29a800c22f260e87dfe3327a0b618
(cherry picked from commit d6e69d774d613e3097d7b1640540b62ec89d2685)

8 years agoMerge "FormatJson: Remove whitespace from empty arrays and objects" into REL1_22
MarkAHershberger [Fri, 8 Nov 2013 02:09:00 +0000 (8 02:09 +0000)]
Merge "FormatJson: Remove whitespace from empty arrays and objects" into REL1_22

8 years agoMerge changes I8a9b4831,I3d570a63 into REL1_22
jenkins-bot [Fri, 8 Nov 2013 02:07:09 +0000 (8 02:07 +0000)]
Merge changes I8a9b4831,I3d570a63 into REL1_22

* changes:
  MWException: Cleanup exception message output
  redact exception traces and abstract getTrace

8 years agoMerge "UploadStash::removeFileNoAuth shouldn't need auth" into REL1_22
MarkAHershberger [Fri, 8 Nov 2013 02:05:45 +0000 (8 02:05 +0000)]
Merge "UploadStash::removeFileNoAuth shouldn't need auth" into REL1_22

8 years agoMerge "MySQL method to find out view + fix fatal in tests" into REL1_22
MarkAHershberger [Fri, 8 Nov 2013 01:58:54 +0000 (8 01:58 +0000)]
Merge "MySQL method to find out view + fix fatal in tests" into REL1_22

8 years agoMerge "wikibits: Add some missing deprecation messages" into REL1_22
jenkins-bot [Thu, 7 Nov 2013 22:39:33 +0000 (7 22:39 +0000)]
Merge "wikibits: Add some missing deprecation messages" into REL1_22

8 years agowikibits: Add some missing deprecation messages
Bartosz Dziewoński [Thu, 7 Nov 2013 22:06:15 +0000 (7 23:06 +0100)]
wikibits: Add some missing deprecation messages

Follow-up to Iab65de1a.

Change-Id: I8925f7dc34b295d6ae3704813e18a4b191f08819
(cherry picked from commit 47b6592f963b2e543f3b564c97d428f45f2c3d8b)

8 years agoMigrate usage of wikibits in legacy protect.js and upload.js
Timo Tijhof [Thu, 7 Nov 2013 17:35:24 +0000 (7 18:35 +0100)]
Migrate usage of wikibits in legacy protect.js and upload.js

Follows-up fcf4934a52.

protect:
* Use jQuery instead.
* Removing now-obsolete dependency.
* Make cell.appendChild more obvious and potentialy faster
  by grouping the dom actions in 1 sequence.

config:
* Removing obsolete dependency.

upload:
* Use jquery.spinner instead.
* Removing now-obsolete dependency.

jquery.spinner:
* While at it, updated documentation to be included in our
  jsduck index, similar to jquery.localize.

jsduck/external.js:
* Added @static to jQuery.ajax which was missing, it showed up
  between instance methods like jQuery#injectSpinner.

The only module left using mediawiki.legacy.wikibits is
mediawiki.legacy.ajax which remains in tact for now.

Bug: 56726
Change-Id: I712112626a99dc2d0090f554c56052770cd0ae88
(cherry picked from commit af4ef8153354b02ec910fd98ec7af024c64ab104)

8 years agoMySQL method to find out view + fix fatal in tests
AlephNull [Fri, 24 May 2013 15:14:40 +0000 (24 11:14 -0400)]
MySQL method to find out view + fix fatal in tests

We were missing a method to list out views defined in a database. This
patch adds in MysqlBase::isView() and MysqlBse::listViews().

Since listViews() cache its result in DatabaseBase::$allViews, we also
introduce a final DatabaseBase::clearViewsCache() to let us clear the
per process cache.

Finally, fixed fatal error when duplicating VIEWs in MySQL.

Conflicts:
RELEASE-NOTES-1.22

bug: 43571
Change-Id: I8650baa4b721fe69ea3e1d557dd76745c0c7754e
(cherry picked from commit e9d53667f43230e84302d0a6653ea7e78a7841ce)

8 years agoMerge "exception: Use MWExceptionHandler::logException in more places" into REL1_22
jenkins-bot [Wed, 6 Nov 2013 21:37:07 +0000 (6 21:37 +0000)]
Merge "exception: Use MWExceptionHandler::logException in more places" into REL1_22

8 years agoMerge "Distinguish redactions from the string "REDACTED" in formatRedactedTrace"...
jenkins-bot [Wed, 6 Nov 2013 21:30:25 +0000 (6 21:30 +0000)]
Merge "Distinguish redactions from the string "REDACTED" in formatRedactedTrace" into REL1_22

8 years agoChange mode of non-executable files back to 0644
Alexandre Emsenhuber [Tue, 5 Nov 2013 07:13:32 +0000 (5 08:13 +0100)]
Change mode of non-executable files back to 0644

Change-Id: Ib9dce1eea8c34986364aabed7f1770101c72c649
(cherry picked from commit 2d0e98df315ffb072e0df36b4027026e901f2c3b)

8 years agoMark Math-specific functions in core as deprecated
physikerwelt (Moritz Schubotz) [Sun, 3 Nov 2013 21:52:17 +0000 (3 22:52 +0100)]
Mark Math-specific functions in core as deprecated

The math specific functions in core are not needed
anymore and should be removed in future versions.
Math can access these settings in the same way as
all other extensions do.

Since Math 2.0 the rendered element has the property
"markerType" => 'nowiki'

Change-Id: I20d3714bed9da864146f133a08cf4ca90eda42ab
(cherry picked from commit 545b712ed4f1a3ac92699dec27414b2850430a64)

8 years agoMWException: Cleanup exception message output
Brad Jorsch [Fri, 1 Nov 2013 18:46:19 +0000 (1 14:46 -0400)]
MWException: Cleanup exception message output

Change I0a9e9244 lost the message when handling a non-MWException
exception, and for a long time MWException's getHTML and getText have
been missing the actual file and line where the exception was thrown.

We may as well use MWExceptionHandler::getLogMessage to fix all of
these, resulting in a more standardized exception output.

Change-Id: I8a9b4831c9c586bafe0a54516ff779cdfb008984

8 years agoredact exception traces and abstract getTrace
Antoine Musso [Mon, 28 Oct 2013 16:56:37 +0000 (28 17:56 +0100)]
redact exception traces and abstract getTrace

* Partially reverts I0a9e92448 (rationale:
   http://www.gossamer-threads.com/lists/wiki/wikitech/401558)
  - wfDebugLog()'d exceptions are always unredacted
  - Other backtraces are redacted by replacing all argument values with class /
    type names.
* Adds a pair of static methods to MWExceptionHandler:
  - MWExceptionHandler::getRedactedTrace
equivalent to Exception::getTrace, but replaces each argument value
in the trace with its class or type name.
  - MWExceptionHandler::getRedactedTraceAsString
    equivalent to Exception::getTraceAsString, but with argument values
likewise redacted.
* The rename of 'formatRedactedTrace' to 'getRedactedTraceAsString' is
  justified on two grounds:
  - 'formatRedactedTrace' didn't actually take a trace object (it took an
exception).
  - 'getRedactedTraceAsString' maintains the symmetry with
    Exception::getTraceAsString.

Conflicts:
includes/Exception.php

Change-Id: I3d570a6385f96a606e1af53c50faa03b9ebacd38

8 years agoexception: Use MWExceptionHandler::logException in more places
Timo Tijhof [Fri, 11 Oct 2013 19:22:40 +0000 (11 21:22 +0200)]
exception: Use MWExceptionHandler::logException in more places

Most code replaced wasn't exactly like what logException does
but most probably should be.

A few implementation differences with the code it replaced in
various places:

* MWException if-guards
  Was there only to prevent a crash because getLogMessage is an
  MWException method. Now that logException is generic, it seems
  sensible to start logging those as well (follows-up a97f3550a0).

* Exception::getTraceAsString
  Now using MWExceptionHandler::formatRedactedTrace instead.
  It wasn't using it because that method didn't exist yet.

Notes:

* DatabaseError::getLogMessage
  Removed as this override was no longer doing anything (we're using
  MWExceptionHandler::getLogMessage instead of $e->getLogMessage).
  Introduced isLoggable() to take over the responsibility of indicating
  when an exception should not be logged (follows-up bcb9f9e1c0d).

* DeferredUpdates and Wiki.php
  Both specificy MWException. Though ApiMain intends to catch all
  and only logged MWException because it couldn't otherwise, these
  actually only catch MWException (as opposed to catching all and
  having an if-statement inside). Left those as-is to have them
  continue propagate other exceptions.

* JobQueueFederated and JobQueueGroup
  All specify to catch JobQueueError only.
  Not sure whether it should catch other exceptions. It now can,
  but I'll leave it as is in case it intends to have those be
  handled elsewhere (or fatal).

Conflicts:
includes/db/DatabaseError.php

Change-Id: I4578a0fe7d95a080f1a3b292ce7ae73a4d5fcaca

8 years agoDistinguish redactions from the string "REDACTED" in formatRedactedTrace
Brad Jorsch [Fri, 25 Oct 2013 14:57:11 +0000 (25 10:57 -0400)]
Distinguish redactions from the string "REDACTED" in formatRedactedTrace

In the output of MWExceptionHandler::formatRedactedTrace, it is not
possible to determine (without checking the configuration) whether arg 0
in "foo('REDACTED')" was redacted or was merely passed the string
"REDACTED".

This patch changes redaction to instead output "foo(REDACTED)" in the
case of redaction. This parallels the situation with arrays and objects,
where for example "foo(Array)" was passed an array while "foo('Array')"
was passed the string "Array".

Change-Id: Ia2a761687c69b630afa3ccd8668b06b28e3ecdd3

8 years agoVector: Set media screen on styles.less
jrobson [Wed, 30 Oct 2013 16:23:49 +0000 (30 09:23 -0700)]
Vector: Set media screen on styles.less

This prevents the styles from overriding the print stylesheet.
Follows-up Ica0b69ad950, which removed it.

Bug: 56366
Change-Id: I3979a90f828ff808deae2f7fcc5c1dd7e83e9b67
(cherry picked from commit 98ef2d9b7e0290bd33378007fd4d45a7d60da1ab)

8 years agoSkinTemplate: Move debug HTML above bottomscripts
Bartosz Dziewoński [Thu, 24 Oct 2013 20:17:59 +0000 (24 22:17 +0200)]
SkinTemplate: Move debug HTML above bottomscripts

mediawiki.debug module, which is loaded at the bottom if
$wgDebugToolbar == true, depends on debug HTML (which sets some
mw.config stuffs with an inline script) being already present.

Bug: 56120
Change-Id: I5570fb4421e8e182fcf5e02754bf9ba6450be346
(cherry picked from commit 779badc31caf65e39b69b2a33b9f18d77a6a3618)

8 years agomediawiki.inspect#dumpTable: fix broken FF workaround
Ori Livneh [Thu, 31 Oct 2013 16:47:15 +0000 (31 09:47 -0700)]
mediawiki.inspect#dumpTable: fix broken FF workaround

In Ib45487d10, we changed to invocation of console#table from
'console.table( data )' to 'console.table.call( console.table, data )'
to force an exception on Firefox, which doesn't define console.table
but doesn't complain if you try to invoke it. It should have been
'console.table.call( console, data )' instead.

Change-Id: Ib2252003f29586a47efb9ec534becc6396936b34
(cherry picked from commit e5867e2d09662f6dc9218066a2ec4f3e3a561d7a)

8 years agoWrap up remaining legacy javascript (IEFixes, wikibits)
Timo Tijhof [Tue, 22 Oct 2013 22:22:39 +0000 (23 00:22 +0200)]
Wrap up remaining legacy javascript (IEFixes, wikibits)

IEFixes:

* Take String.prototype.hasClass off the prototype and into
  a local function.

* Removed module definition "mediawiki.legacy.IEFixes" as it
  is not used anywhere (only pollutes the startup module and
  gives a false impression that its dependencies are indeed
  properly being enforced). The file is loaded raw from
  wikibits.js if isIE6 is true.

wikibits:

* Re-ordered to group related methods together.
* Moved up wgBreakFrames so we don't waste any time running
  code if we'll break the frame anyway.
* All properties that haven't been removed to this date are now
  wrapped in mw.log.deprecate.
  - Replaced most with dummy values of the same type.
  - Kept a few ones around to make highly popular method still
    work (such as addOnloadHook).
  - Kept the importScript family of functions unwrapped for now
    as those don't have a proper replacement until users can
    create modules (bug 34958). Though we could promote these to
    mw.util or mw.loader, that would not solve anything and only
    require scripts to be changed again in the future. Can be kept
    as-is for now and is not yet formerly deprecated.
* Created a local reference to the "window" global as it is
  referenced quite often here.

Change-Id: Iab65de1a0a87abad38b834828cd838dfd1c48ba1
(cherry picked from commit fcf4934a52759c5428d5c2e7663d4c8b2cd2deea)

8 years agovector: Restore gray search input placeholder
Bartosz Dziewoński [Sun, 27 Oct 2013 19:44:15 +0000 (27 20:44 +0100)]
vector: Restore gray search input placeholder

Broken in I1d9657a5.

Bug: 54069
Change-Id: I2d86d75dd023eda349fc9fe69416e9682201eeb3
(cherry picked from commit 6679733a690a62bb3b91e063e2e2fcbd9fc6a1ff)

8 years agoVector: Remove media=screen from skins.vector.beta module
Timo Tijhof [Wed, 30 Oct 2013 20:25:31 +0000 (30 21:25 +0100)]
Vector: Remove media=screen from skins.vector.beta module

Follows-up 8b6ed4d

Change-Id: Iee20d5003470b794e288c0e40842696b2b6dccb0
(cherry picked from commit 7176bd254e60e32e8ef6b68bcdadd9d8ac2254bb)

8 years agoBackport information boxes' styles from vforms to shared CSS
MatmaRex [Thu, 5 Sep 2013 13:37:14 +0000 (5 15:37 +0200)]
Backport information boxes' styles from vforms to shared CSS

They're obviously prettier and non-intrusive enough to fit old
interfaces. The colors are changed to more pastel ones and the general
size of the boxes is reduced.

Also remove unnecessary bolds on the informations on
Special:Preferences and Special:ChangePassword.

Change-Id: Ieae62db1a124261ae7f5bf67aced8b84cfbadd3d
(cherry picked from commit 0b539d7fa1fc312b3be6804a2e51713da86fefee)

8 years agoMerge "Typo" into REL1_22
jenkins-bot [Tue, 29 Oct 2013 18:14:06 +0000 (29 18:14 +0000)]
Merge "Typo" into REL1_22

8 years agoTypo1.22.0rc0
Mark A. Hershberger [Tue, 29 Oct 2013 18:05:51 +0000 (29 14:05 -0400)]
Typo

Change-Id: Iac71d87a7e8cedbb57c660643417bfaf698aca10

8 years agoUploadStash::removeFileNoAuth shouldn't need auth
Brad Jorsch [Tue, 29 Oct 2013 15:56:35 +0000 (29 11:56 -0400)]
UploadStash::removeFileNoAuth shouldn't need auth

UploadStash::getFile has a "noAuth" parameter, which should be set true
when this is called from UploadStash::removeFileNoAuth.

Callers should already be doing their own auth checking, or calling
UploadStash::removeFile.

Bug: 56298
Change-Id: Ic70c4e2bc6df5cb9b139a3631766f8ff0ec4ef02
(cherry picked from commit d4b250ad380b024620b724c9f9485e79ea712798)

8 years agoFormatJson: Remove whitespace from empty arrays and objects
Kevin Israel [Tue, 8 Oct 2013 21:23:06 +0000 (8 17:23 -0400)]
FormatJson: Remove whitespace from empty arrays and objects

As noted in c370ad21d7f8, the pretty output can differ between
Zend PHP and HHVM. This change adds some post-processing to make
the output consistent across implementations and with JavaScript
JSON.stringify() and Python json.dumps(); all whitespace between
the opening and closing brackets/braces is removed.

Change-Id: I490e0ff1fac3d6c3fb44ab127e432872c0301a9d
(cherry picked from commit b6a5bb484d90c6705bd1b010efcc2c1c18be1f34)

8 years agoMerge "installer: Run the LESS compiler for *.less files" into REL1_22
jenkins-bot [Tue, 29 Oct 2013 01:52:53 +0000 (29 01:52 +0000)]
Merge "installer: Run the LESS compiler for *.less files" into REL1_22

8 years agoinstaller: Run the LESS compiler for *.less files
Kevin Israel [Mon, 14 Oct 2013 01:34:58 +0000 (13 21:34 -0400)]
installer: Run the LESS compiler for *.less files

Includes the following improvements:

* Use the ResourceLoader module definitions (with a hardcoded list of
  module names) instead of a hardcoded list of filenames.
* Make the errors more discoverable like we do in load.php, prepending
  them instead of burying them in the middle somewhere.

Bug: 55589
Change-Id: I9e5e641ba9f77acdf4f910d46f506e38d7efecad

8 years agoMerge "Revert "mediawiki.log: Do not dynamically redefine mw.log.deprecate"" into...
jenkins-bot [Tue, 29 Oct 2013 00:41:15 +0000 (29 00:41 +0000)]
Merge "Revert "mediawiki.log: Do not dynamically redefine mw.log.deprecate"" into REL1_22

8 years agoRevert "mediawiki.log: Do not dynamically redefine mw.log.deprecate"
Krinkle [Tue, 29 Oct 2013 00:34:01 +0000 (29 00:34 +0000)]
Revert "mediawiki.log: Do not dynamically redefine mw.log.deprecate"

This reverts commit d1e99dd5b20b44ccc3737025501cb81670885dea.

Change-Id: I4f3ef65e63f7865da64b2efa0c5b2951e5930415

8 years agoinstaller: Run the LESS compiler for *.less files
Kevin Israel [Mon, 14 Oct 2013 01:34:58 +0000 (13 21:34 -0400)]
installer: Run the LESS compiler for *.less files

Includes the following improvements:

* Use the ResourceLoader module definitions (with a hardcoded list of
  module names) instead of a hardcoded list of filenames.
* Make the errors more discoverable like we do in load.php, prepending
  them instead of burying them in the middle somewhere.

Bug: 55589
Change-Id: Iab78a60209ab46a10d4c492c75527e717f36f803
(cherry picked from commit 8cc7208753c45acf2c47f78b0569e18150f193a5)

8 years agoFixed use of wrong callback array element
Aaron Schulz [Fri, 25 Oct 2013 06:12:04 +0000 (24 23:12 -0700)]
Fixed use of wrong callback array element

bug: 56124
Change-Id: Ia9f058f42616f5c7c5936733747d0c3a8d56dc19
(cherry picked from commit 5b876967a7f49a25c299abb8e3d0ab172f80b164)

8 years agoAdd correct font color override to beta variables
jrobson [Mon, 28 Oct 2013 18:59:05 +0000 (28 11:59 -0700)]
Add correct font color override to beta variables

Note that originally the font color was specified incorrectly in
variables.less (fixed in I118215e7578e8af94a6909988620dcf04805d14a)

This restores the color to how it should be in beta
Also rename variable as the name is very misleading - it only applies
to the content

Change-Id: Iff397075ef4d11b6f815d8a596ed249d2708398a
(cherry picked from commit c6c3241806f819ae399d977fa1526450239b4898)

8 years agovector: Restore @body-font-color to black
Bartosz Dziewoński [Sat, 26 Oct 2013 11:04:31 +0000 (26 13:04 +0200)]
vector: Restore @body-font-color to black

Changed in Ica0b69ad, I presume accidentally.

https://en.wikipedia.org/w/?oldid=578807552#Font_color_of_article_text

Change-Id: I118215e7578e8af94a6909988620dcf04805d14a
(cherry picked from commit a2a76d7744e9d5fd007725ab66ab66cf002423fe)

8 years agomediawiki.log: Do not dynamically redefine mw.log.deprecate
Bartosz Dziewoński [Sat, 26 Oct 2013 12:14:46 +0000 (26 14:14 +0200)]
mediawiki.log: Do not dynamically redefine mw.log.deprecate

There's very little gain in doing it and it's annoying for static code
analysis and IDE-like functionality such as jumping to function
definition or listing all functions defined in a file.

Change-Id: Ida6c99539157de266c8e70eff344bd6491e39684
(cherry picked from commit dd813717156c6210cebb4f7692d6a41a606e9b8a)

8 years agomw.loader: Always log exceptions caught from userland callbacks
Timo Tijhof [Fri, 25 Oct 2013 19:15:00 +0000 (25 21:15 +0200)]
mw.loader: Always log exceptions caught from userland callbacks

We usually don't catch these at all (not supposed to, as they're
foreign). But in case of handlePending() we catch them because
we need to ensure the state is kept track of properly (an error
is never final in javascript since execution always continues).

However we should at least log it in that case. We already did this
in case of the error() callback, it now does this for the ready()
callback as well.

Bug: 55989
Change-Id: I61f109178833fed60fbba7725fd47b4ff3d2edf4
(cherry picked from commit 8bee2b1fdfa85c4b26cb2d747a8d599b018a5d4d)

8 years agoMerge "Fix Tidy quietly breaking TOC disabling" into REL1_22
jenkins-bot [Fri, 25 Oct 2013 19:48:16 +0000 (25 19:48 +0000)]
Merge "Fix Tidy quietly breaking TOC disabling" into REL1_22

8 years agomediawiki.js: Handle error better in log() and move out of mw.loader
Timo Tijhof [Fri, 25 Oct 2013 18:45:46 +0000 (25 20:45 +0200)]
mediawiki.js: Handle error better in log() and move out of mw.loader

console.error (in Chrome dev tools) takes an Error object. It
renders the stack trace nicely (incl. dynamic references to files)
but doesn't stringify the exception itself. It renders it as an
object (eg. no "{}" instead of "TypeError: Foo bar").

Some of the callers were embedding e.message manually. That was
better though, that still omitted the class (eg. "TypeError").
Error#toString composes the full message incl. class name prefix.

Change-Id: Id5b9872e2050326ab83889e3a806d015ec2ff3eb
(cherry picked from commit 4f23099c223a7525774afd4d18b89cff22374581)

8 years agoFix Tidy quietly breaking TOC disabling
Max Semenik [Fri, 25 Oct 2013 18:02:11 +0000 (25 22:02 +0400)]
Fix Tidy quietly breaking TOC disabling

The functionality was introduced in I2889bcb9
but doesn't work in presence if Tidy.

Change-Id: Ibf96cc3bc94fac75fd92ec5b9205011fcb68f0c2
(cherry picked from commit d6f673c1157b75b33f9eeb3169fc2be25fb99da0)

8 years agoTriple default $wgMaxShellMemory (raise to 300 MB)
Bartosz Dziewoński [Wed, 23 Oct 2013 20:56:50 +0000 (23 22:56 +0200)]
Triple default $wgMaxShellMemory (raise to 300 MB)

100 MB is no longer sufficient.

That value was chosen back in 2006 (r14795); the world has largely
moved on to 64-bit programs since then, and applications such as
ImageMagick seem to use 16-bit precision for each image channel.
It's not enough to scale regular large-ish images on default system
settings anymore.

Bug: 34241
Change-Id: I66bbe12925689f9273f3b5fb29adc8c15c828c70
(cherry picked from commit 45d3656a4c8e169cadc5bda339296cf0aa00556f)

8 years agoMerge "mediawiki.inspect: Support IE8's style.sheet.rules property" into REL1_22
jenkins-bot [Thu, 24 Oct 2013 21:42:21 +0000 (24 21:42 +0000)]
Merge "mediawiki.inspect: Support IE8's style.sheet.rules property" into REL1_22

8 years agoMerge "Set $parentLen in contributions" into REL1_22
jenkins-bot [Thu, 24 Oct 2013 21:38:00 +0000 (24 21:38 +0000)]
Merge "Set $parentLen in contributions" into REL1_22

8 years agomediawiki.inspect: Support IE8's style.sheet.rules property
Bartosz Dziewoński [Thu, 24 Oct 2013 19:31:49 +0000 (24 21:31 +0200)]
mediawiki.inspect: Support IE8's style.sheet.rules property

Standards-compliant browsers use 'cssRules', IE8 uses 'rules',
some browsers (e.g. Chrome) support both.

Bug: 56107
Change-Id: Ief0b5e38c8ff29efea510bf3725127c2bbfccd59
(cherry picked from commit 6fad6f5d24ecce46317fe65b53e7c4c7f9c63ef5)

8 years agoFix undefined variable in Status::getMessage()
aude [Thu, 24 Oct 2013 19:17:39 +0000 (24 19:17 +0000)]
Fix undefined variable in Status::getMessage()

If $shortContext and $longContext are false, and there
are errors, then $s is undefined.

Change-Id: Ie07f80b43a48a6fc4ed28b2c519f51fd32690bc8
(cherry picked from commit 92e284d3fa62f45e20fed34c4359c575481d583c)

8 years agoSet $parentLen in contributions
Bartosz Dziewoński [Thu, 24 Oct 2013 20:25:10 +0000 (24 22:25 +0200)]
Set $parentLen in contributions

Follow-up to I77dd45eb.

Bug: 56115
Change-Id: I17bd160577e6b287cc5a61e2a3b983b035c87f81
(cherry picked from commit 542caf6dd6c025ec5a35ec960d0df2442a152555)

8 years agoMake TOC hideable
Max Semenik [Thu, 22 Aug 2013 22:22:03 +0000 (23 02:22 +0400)]
Make TOC hideable

Currently, if an extension doesn't want a TOC, it has to remove it manually.
This change wraps the TOC in markers that make it easy to remove it in ParserOutput
on demand without fragmenting the parser cache with stuff like "use/not use TOC".

Change-Id: I2889bcb9eb999c9049601e92440132118e1a8a41
(cherry picked from commit 21c1c7d025365540f17be4f7ae19184e1ccca4cc)

8 years agoMerge SimpleAntiSpam extension into core
Kunal Mehta [Thu, 17 Oct 2013 06:48:48 +0000 (16 23:48 -0700)]
Merge SimpleAntiSpam extension into core

Adds an empty, hidden input field to the edit interface, and will
reject any edit if that field is filled in. This will protect
against the simplest form of spambots.

Localized messages will be imported separately.

Bug: 52063
Change-Id: I185b6a1e232299f496244a23f4bf0dc6ea22b6c9
(cherry picked from commit 0988d1200dd5d67719baf076cdbe3e363801ac23)

8 years agoupdate $wgVersion
Mark A. Hershberger [Thu, 24 Oct 2013 18:24:23 +0000 (24 14:24 -0400)]
update $wgVersion

Change-Id: Ie4fda06c2221b6bc4300166b8a872d79dbd5fe06

8 years agoFix double-parsing of account creation messages.
Tyler Anthony Romeo [Sun, 30 Jun 2013 20:45:45 +0000 (30 22:45 +0200)]
Fix double-parsing of account creation messages.

Account creation messages don't need to be parsed. This is
a temporary fix to follow up when double-parsing was accidentally
added in 69ea4400037 (I402c6bebcfe).

Bug: 44718
Bug: 52191
Change-Id: I333d5468820994625348316ebf6c57d4df025284

8 years agoCleanup skins/SiteBarTest and @todo/covers
addshore [Tue, 22 Oct 2013 10:58:24 +0000 (22 12:58 +0200)]
Cleanup skins/SiteBarTest and @todo/covers

Change-Id: I501d04ddbeee23539337b68142ee6c1371a63d98

8 years ago@covers for all GlobalFunc tests
addshore [Thu, 24 Oct 2013 09:53:24 +0000 (24 10:53 +0100)]
@covers for all GlobalFunc tests

Also split 2 tests off into their correct test classes,
this methods are clearly no longer global functions

Change-Id: I482433f3099e72507a766e85d9576ff36e58b9ad

8 years agoImprove linkprefix regular expressions
Brad Jorsch [Tue, 27 Aug 2013 19:28:52 +0000 (27 15:28 -0400)]
Improve linkprefix regular expressions

The regular expression in the linkprefix message is run against the
entire page up to each wikilink, and is expected to capture one group
having everything except the prefix and another having only the prefix.
For long pages this winds up being a lot of text, so inefficient regular
expressions are going to cause problems.

The current regex is this:

  /^(.*?)([a-zA-Z\\x80-\\xff]+)$/sD

This is not efficient: it will scan through the string trying to match
against every run of one or more letters/non-ASCII characters,
backtracking at every one except possibly the last. The only reason this
hasn't been a huge problem everywhere is because only a few languages
have this feature enabled.

This change replaces this with this regex:

  /^((?>.*(?<![a-zA-Z\\x80-\\xff])))(.+)$/sD

This is rather more efficient: it will grab the whole string (which is
actually fast even for huge strings), then back off character by
character until it finds one that isn't a letter/non-ASCII.

Note that the above could be simplified somewhat:

  /^((?>.*[^a-zA-Z\\x80-\\xff]|))(.+)$/sD

The performance improvement here is minor, and Gujarati, Church Slavic,
Udmurt, and Ukrainian would still need the other style for their current
implementations.

For Gujarati, we also use another regex trick: a look-behind assertion
in PCRE must be fixed length, so something like (?<!a|bb) won't work.
But that regex fragment is equivalent to (?<!a)(?<!bb) which is allowed,
so we use that instead.

Bug: 52865
Change-Id: Iaa7eaa446b3f045a9ce970affcb2a889f44bdefd

8 years agoFix scope on all /phpunit test methods
addshore [Wed, 23 Oct 2013 22:51:31 +0000 (23 23:51 +0100)]
Fix scope on all /phpunit test methods

Change-Id: I3ce92463d485a0fb23e464e9a8059330f32d79af

8 years agoCleanup tests/includes/media
addshore [Wed, 23 Oct 2013 22:12:39 +0000 (23 23:12 +0100)]
Cleanup tests/includes/media

- Adds @covers tags
- fixes comments
- fixes scope
- adds @todos
- split files per class

Change-Id: Id5aaa20769725a96f22fb838d376697c250874a5

8 years agoMerge "mediawiki.inspect: use $.toJSON & add workaround for FF oddity"
jenkins-bot [Thu, 24 Oct 2013 00:53:48 +0000 (24 00:53 +0000)]
Merge "mediawiki.inspect: use $.toJSON & add workaround for FF oddity"

8 years agomediawiki.inspect: use $.toJSON & add workaround for FF oddity
Ori Livneh [Thu, 24 Oct 2013 00:37:21 +0000 (23 17:37 -0700)]
mediawiki.inspect: use $.toJSON & add workaround for FF oddity

* Use $.toJSON rather than JSON.stringify. Make mediawiki.inspect depend on
  jquery.json.
* Firefox doesn't define a console.table, but doesn't throw an exception either
  if you attempt to invoke it. Use Function.prototype#call to call Firefox's
  bluff.

Change-Id: Ib45487d10488f08a98d9635ab9a2a9212e9ef69f

8 years agoMerge "New hook accommodates non-revision rc queries"
jenkins-bot [Wed, 23 Oct 2013 23:44:42 +0000 (23 23:44 +0000)]
Merge "New hook accommodates non-revision rc queries"

8 years agoNew hook accommodates non-revision rc queries
Erik Bernhardson [Tue, 15 Oct 2013 22:21:34 +0000 (15 15:21 -0700)]
New hook accommodates non-revision rc queries

Within Special:RecentChanges the default non-extended query contains

    ( rc_this_oldid=page_latest OR rc_type=3 )

Wikidata has previously used the SpecialWatchlistQuery hook to look for
this exact string and change rc_type=3 to rc_type IN (3,5).  Flow is another
type of change that doesn't have a matching row in revisions to match
page_latest for and needs to be added to this query.

This patch adds a new hook, SpecialWatchlistGetNonRevisionTypes, which allows
different extensions to add to a list of values for rc_type (or rc_source once
85787 is merged).  This will allow multiple extensions to affect the resulting
query without them breaking eachother.

Change-Id: Id6916fe999c0faa38de878b7b5687e7ea00901bd

8 years agoAdd $wgSemiprotectedRestrictionLevels
Brad Jorsch [Fri, 18 Oct 2013 14:54:58 +0000 (18 10:54 -0400)]
Add $wgSemiprotectedRestrictionLevels

It's possible that a wiki could introduce new protection levels that
should be considered "semiprotected". For example, if an
"emailconfirmed" protection level were added and an appropriate entry
were made in $wgAutopromote, that might be considered semi-protection
since anyone can automatically gain the ability to edit those pages
merely by setting and confirming their email address.

The most straightforward way to take care of this is to add a config
variable to specify which protection levels are considered
"semiprotected". So let's do that.

Also, let's take the opportunity to make
$title->isSemiProtected( 'create' ) works correctly.

Bug: 43462
Change-Id: Ic9db6ff6cbd84bd9734be09efbea5a5891197fa0

8 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Wed, 23 Oct 2013 18:58:35 +0000 (23 18:58 +0000)]
Localisation updates from translatewiki.net.

Change-Id: I0073d11e39dd5a11d7c8c44b80401ad7b8fd6313

8 years agoMerge "mediawiki.util: Use 'wikipage.content' hook for TOC hiding"
jenkins-bot [Wed, 23 Oct 2013 18:46:02 +0000 (23 18:46 +0000)]
Merge "mediawiki.util: Use 'wikipage.content' hook for TOC hiding"

8 years agoMerge "Remove all instances of the word "iff""
jenkins-bot [Wed, 23 Oct 2013 18:16:48 +0000 (23 18:16 +0000)]
Merge "Remove all instances of the word "iff""

8 years agoRemove all instances of the word "iff"
Tim Starling [Tue, 11 Jun 2013 23:01:52 +0000 (12 09:01 +1000)]
Remove all instances of the word "iff"

It's elitist mathematical jargon. In all cases dealt with here, it adds
no additional meaning compared to "if", beyond what was already obvious
from context. Thus, its only purpose is to smugly demonstrate that the
author attended their second-year mathematics classes, at the expense of
causing confusion for everyone who doesn't have such a background.

If you really think you need to convey extra information beyond what
"if" gives you, the English language contains plenty of devices for doing
so, without resorting to neologisms.

Change-Id: Iae21095d02ec2935c10e94f532235c2671c115b1

8 years agoMerge "Fix doc error in new incr test"
jenkins-bot [Wed, 23 Oct 2013 17:01:14 +0000 (23 17:01 +0000)]
Merge "Fix doc error in new incr test"

8 years agoFix doc error in new incr test
Matthew Flaschen [Wed, 23 Oct 2013 16:53:00 +0000 (23 12:53 -0400)]
Fix doc error in new incr test

It covers all implementations of the abstract class method BagOStuff::incr.

Change-Id: I763985477b8564857a0905019c4485dd36f84539

8 years agoMerge "tablesorter: Unbreak abbreviated month name support"
jenkins-bot [Wed, 23 Oct 2013 15:54:16 +0000 (23 15:54 +0000)]
Merge "tablesorter: Unbreak abbreviated month name support"

8 years agoAddress PHP CodeSniffer errors and warnings
Siebrand Mazeland [Wed, 23 Oct 2013 12:16:03 +0000 (23 14:16 +0200)]
Address PHP CodeSniffer errors and warnings

One class of errors left unaddressed: Class name "WebInstaller_Language"
is not in camel caps format. I think this can be changed, too, but I
wasn't able to quickly find out where class names are being created.

Change-Id: I920b0231db1b70b68c6c8907257c288a0e112668

8 years agoGeneral cleanup of Parser tests
addshore [Tue, 22 Oct 2013 23:50:38 +0000 (23 00:50 +0100)]
General cleanup of Parser tests

 - Fixes scope
 - Adds covers tags

Change-Id: I6024f2f7cc7a1812a417c6c389b0a15addde0b5e

8 years agotablesorter: Unbreak abbreviated month name support
Bartosz Dziewoński [Wed, 23 Oct 2013 09:59:40 +0000 (23 11:59 +0200)]
tablesorter: Unbreak abbreviated month name support

Regression from If758499f. Trailing dot was being removed
for genitive forms instead of abbreviated forms.

Bug: 56038
Change-Id: I353da785ff4a1203ae54a981c3c946f9df452902

8 years agoCleanup MagicVariableTest
addshore [Tue, 22 Oct 2013 09:46:48 +0000 (22 11:46 +0200)]
Cleanup MagicVariableTest

 - Give methods scope
 - Make providers static
 - Add @covers todo
 - Merge the Providers file that is only used in here

Change-Id: I60a6bbd5a8ad3d9d414de493ec2b083f52114a7b

8 years agoMerge "mw.api.postWithToken now forwards promise on fail if we have token"
jenkins-bot [Wed, 23 Oct 2013 07:11:21 +0000 (23 07:11 +0000)]
Merge "mw.api.postWithToken now forwards promise on fail if we have token"

8 years agoParser::replaceInternalLinks: fix batching
Kevin Israel [Tue, 15 Oct 2013 13:42:48 +0000 (15 09:42 -0400)]
Parser::replaceInternalLinks: fix batching

The parser unnecessarily made individual checks for existence of
pages that were neither in LinkCache nor linked only with a fragment.
A Title::isKnown() call in Parser::replaceInternalLinks2() (added in
bca8b8ad7d2f) caused this.

Title::isKnown() was used to avoid treating a link to a distinct page
as a self-link even when the title happened to match one of the variants
returned by Language::autoConvertToAllVariants(). This change fixes
the bug by moving the problematic portion of the self-link check into
LinkHolderArray::doVariants().

Change-Id: I586e11e8b47308980ea04087ebc4246c397a8f53

8 years agoUse restriction-level-* messages in Linker::formatTemplates
Brad Jorsch [Fri, 18 Oct 2013 14:29:36 +0000 (18 10:29 -0400)]
Use restriction-level-* messages in Linker::formatTemplates

The current implementation of Linker::formatTemplates only checks for
"sysop" and "autoconfirmed", and completely ignores any other protection
levels. That needs fixing.

Rather than introducing additional messages "template-protected-*" to
match template-protected and template-semiprotected, let's just use the
existing restriction-level-foo messages and wrap them in parentheses.

The old messages are kept for backwards compatability, but could
probably be considered deprecated.

Bug: 43462
Change-Id: I0c507f4ecc1921f599acbda834fa55e96388fa7b

8 years agoAvoid master queries in Revision::newFromTitle(..., Revision::READ_NORMAL)
Tim Starling [Fri, 7 Jun 2013 00:31:37 +0000 (7 10:31 +1000)]
Avoid master queries in Revision::newFromTitle(..., Revision::READ_NORMAL)

The fallback to master makes sense in Revision::newFromId(), since a
revision ID known to exist by some other means might be present in the
master but not in the slave. But it doesn't make sense for
Revision::newFromTitle(), where by far the most common cause of this
case being hit is the page being nonexistent.

Change-Id: I41189fcde1b8065ac134982241376d63b78732a1

8 years agoMerge "Fix Redis increment behavior by using BagOStuff->incr instead"
jenkins-bot [Tue, 22 Oct 2013 23:49:01 +0000 (22 23:49 +0000)]
Merge "Fix Redis increment behavior by using BagOStuff->incr instead"

8 years agoMerge "Test BagOStuff->incr method"
jenkins-bot [Tue, 22 Oct 2013 23:47:25 +0000 (22 23:47 +0000)]
Merge "Test BagOStuff->incr method"

8 years agoFix Redis increment behavior by using BagOStuff->incr instead
Matthew Flaschen [Tue, 22 Oct 2013 21:35:23 +0000 (22 17:35 -0400)]
Fix Redis increment behavior by using BagOStuff->incr instead

Due to the PHP serialization, the Redis native INCR and INCRBY do not
work.  This instead falls back on the parent class's incr, which uses
lock and unlock, and incrementing on the PHP side.

Bug: 55986
Change-Id: I500199aeb935963ca118fde163bd7ba0cba8f79f

8 years agoTest BagOStuff->incr method
Matthew Flaschen [Tue, 22 Oct 2013 05:55:25 +0000 (22 01:55 -0400)]
Test BagOStuff->incr method

Change-Id: I3b72f19df82ee302dee47dcf22b69ed9bb6ff8e0

8 years agomediawiki.util: Use 'wikipage.content' hook for TOC hiding
Fomafix [Sun, 22 Sep 2013 14:15:20 +0000 (22 16:15 +0200)]
mediawiki.util: Use 'wikipage.content' hook for TOC hiding

Bug: 54437
Change-Id: I82f441111bf3d6018b569dc728a3c152b721db7d

8 years agolockmanager: QuorumLockManager subclasses can get EX/SH locks at once
Aaron Schulz [Sun, 16 Jun 2013 20:48:17 +0000 (16 13:48 -0700)]
lockmanager: QuorumLockManager subclasses can get EX/SH locks at once

* Also reduced rount trips in doUnlockingRequestBucket().
* Also removed some redundant doc comments.

Change-Id: I81878e92332509bd7fda9ddeef950b774f5b015d

8 years agoCleanup /languages/* tests
addshore [Tue, 22 Oct 2013 10:32:29 +0000 (22 12:32 +0200)]
Cleanup /languages/* tests

This change:
 - Adds method scope
 - adds @covers tags
 - adds various @todos
 - fixes some comments

Before the changes tests ran with:
   1383 tests, 1412 assertions 10 skips
After changes the results remain the same

Change-Id: Iee57447bdb47026952ef5dcce6fed5dad0f80e52

8 years agomw.api.postWithToken now forwards promise on fail if we have token
Niklas Laxström [Tue, 22 Oct 2013 09:50:05 +0000 (22 09:50 +0000)]
mw.api.postWithToken now forwards promise on fail if we have token

Without this fix the callers of this function could not read the
failure code and result, because we returned undefined. Because
we are using a filter function, we need to explicitly return the
promise to pass it forward.

Change-Id: I71984ac827618459f723b0b9f47d4dc29e2a2f70

8 years agoAdd more @covers tags and test cleanup
addshore [Mon, 21 Oct 2013 21:09:13 +0000 (21 23:09 +0200)]
Add more @covers tags and test cleanup

Other cleanup includes
 - Adding method scopes
 - Fixing php comments
 - Adding todos

Change-Id: I0a231008e6a59110ffcab6af1bd8c4d3ee13f21d

8 years agoMerge "Mention the new HTMLForm 'vform' display format."
Mwalker [Tue, 22 Oct 2013 02:34:45 +0000 (22 02:34 +0000)]
Merge "Mention the new HTMLForm 'vform' display format."

8 years agoMerge "Fixes for duplicateStderr (I833aeb3a)"
jenkins-bot [Tue, 22 Oct 2013 02:34:27 +0000 (22 02:34 +0000)]
Merge "Fixes for duplicateStderr (I833aeb3a)"

8 years agoMention the new HTMLForm 'vform' display format.
S Page [Tue, 22 Oct 2013 02:26:08 +0000 (21 19:26 -0700)]
Mention the new HTMLForm 'vform' display format.

Change Id03d185bbee990595bfc469a61163cc598fc3441 added the feature.

Change-Id: I17ccb127e47047dc32f930ce1775496ea22410d2

8 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Mon, 21 Oct 2013 22:51:33 +0000 (21 22:51 +0000)]
Localisation updates from translatewiki.net.

Change-Id: I0539a27c72b9a270db4e3b29a4c357e40d806353

8 years agoMerge "mediawiki.inspect: add CSS report"
jenkins-bot [Mon, 21 Oct 2013 20:35:36 +0000 (21 20:35 +0000)]
Merge "mediawiki.inspect: add CSS report"

8 years agoMerge "Added a few more trx sanity checks to DatabaseBase"
jenkins-bot [Mon, 21 Oct 2013 20:28:44 +0000 (21 20:28 +0000)]
Merge "Added a few more trx sanity checks to DatabaseBase"

8 years agoMerge "Have list items occupy their own line"
jenkins-bot [Mon, 21 Oct 2013 20:24:22 +0000 (21 20:24 +0000)]
Merge "Have list items occupy their own line"

8 years agoLocalisation updates from http://translatewiki.net.
Translation updater bot [Mon, 21 Oct 2013 19:42:49 +0000 (21 19:42 +0000)]
Localisation updates from translatewiki.net.

Change-Id: I922e660fafc7a952129beebeaed001712f5c2bc1

8 years agoMerge "Clean up old title on move before reset article id"
jenkins-bot [Mon, 21 Oct 2013 17:45:26 +0000 (21 17:45 +0000)]
Merge "Clean up old title on move before reset article id"

8 years agoMerge "jquery.localize: Fix incorrect use of void tag for <html:msg>"
jenkins-bot [Mon, 21 Oct 2013 17:43:37 +0000 (21 17:43 +0000)]
Merge "jquery.localize: Fix incorrect use of void tag for <html:msg>"

8 years agoMerge "Fix typo erronously -> erroneously"
jenkins-bot [Mon, 21 Oct 2013 17:39:13 +0000 (21 17:39 +0000)]
Merge "Fix typo erronously -> erroneously"

8 years agoMerge "Add 'RedisPubSubFeedEngine' feed engine"
jenkins-bot [Mon, 21 Oct 2013 17:37:36 +0000 (21 17:37 +0000)]
Merge "Add 'RedisPubSubFeedEngine' feed engine"