Change case to use the canonical names.

Change-Id: Ib2640e608ac4d33871446b15fca3780eb7715f1d
(bug 40353) SpecialDoubleRedirect: Fix for interwiki redirects

Previously there were problems:
- Non-double redirects that point to interwiki of the same name
  were also included (because it ignored rd_interwiki, it looked
  up a local page by that name and found a redirect, again etc.)

  e.g.:
  "Foo (edit) →‎ Foo →‎ somewiki:Foo"

- Double redirects that end in an interwiki appeared to be
  linking to a local one

  "X (edit) →‎ Y →‎ Y" // the second Y is really somewiki:Y

- Double redirects where the end is an interwiki and of a
  different title, are not included in the results.

- Redundant third join to page (pc), the information needed from
  that table (title, namespace) are already available in the
  redirect table. Redundant joins are generally not a bug, but
  in this case the third join caused interwiki targets to be
  excluded in most cases since those external pages did not
  exist in the local table (except for coincidences).

Example wiki:
* Foo redirects to somewiki:Foo
* X redirects to Y
* Y redirects to somewiki:Y
* A redirects to B
* B redirects to somewiki:C

Before (http://sqlfiddle.com/#!2/1d656/9/0):

* Foo →‎ Foo →‎ Foo

* X →‎ Y →‎ Y

After (http://sqlfiddle.com/#!2/1d656/6/0):

* X →‎ Y →‎ somewiki:Y

* A →‎ B →‎ somewiki:C

Change-Id: I986f3a03d71dd6457842e6189653bd606f4fa97e
[FileRepo] Throw an exception if a storage key is invalid.

Change-Id: Ie479d940dddcf7a9eca5d68a76fbe3fa70a6d4d7
mediawiki.action.edit.preview: New module replacing preview.js

With all the recent improvements, it's time this module got
promoted away from legacy. Its no longer just an old script to
that provides preview functionality and is minimally
maintained within "legacy", its reborn!

Minor clean up follows-up:
* e75054174c944d8a78a2c2822abe2fe161f7d6ad
* b12dc64a1198f6b094a5a60307412ff91f0bbf49

Change-Id: I85ca97a1d8df25a09baad78030d6da379a06c0f1
Limit bad transactions warnings to those involving possible writes.

Change-Id: I3f1dd5fd34c5554619936471a2c9687a8f501006
Replace RLE/LRE/PDF with RLM/LRM.

The main purpose of these control characters is to ensure the correct display
of parentheses in a mixed rtl/ltr environment. Putting RLM/LRM in the end is
enough for doing this and prevents problems with capitalization (like
with Norsk).

Change-Id: I4698bd675802125e42cc9200bd1f7a86be626631
Add an API log

During incident response, it was not possible to tell what API modules
were being requested and by whom, since the action parameter is often
posted. This change logs the API parameters whether they are posted or
sent in the query string.

I did try to get the API parameters from the module, but that turns out
to be difficult. Modules create submodules (generators, page sets) as
local variables, which are created in a procedural style and destroyed
before logging is done, so there is no easy way to query them for
parameter lists after execution completes.

In ApiOptionsTest, use a real ApiMain object like all the other API test
cases, rather than a mock object. Otherwise the test fails.

Change-Id: Idc786007fe61811d1874f29b5ce4762dd97b1847
Merge "Replace RLE/LRE/PDF with RLM/LRM."
Merge "Limit bad transactions warnings to those involving possible writes."
Merge "[FileRepo] Throw an exception if a storage key is invalid."
[FileBackend] Added FileBackend::getWikiID() function.

Change-Id: Idd9be6c72d494fad37ac62e274c1e115ff97cdec
Merge "[FileBackend] Added FileBackend::getWikiID() function."
improving comment re DateFormatter.php

Change-Id: Ida5967c69792792b653390752da6536b55fbd0a5
Merge "improving comment re DateFormatter.php"
Merge "(bug 40353) SpecialDoubleRedirect: Fix for interwiki redirects"
Merge "mediawiki.action.edit.preview: New module replacing preview.js"
Localisation updates from http://translatewiki.net.

Change-Id: Ia4ad3fe20ec69c845fef2b4a63eb25e37fa5eedf
Added several template tests to stress Parsoid template RT-ing.

Change-Id: I294e5566b00bba260046f403b247d4d5d169b14f
Merge "Added several template tests to stress Parsoid template RT-ing."
Merge "Change case to use the canonical names."