Made pool counter better handled nested calls

* This is useful for the "GetLocalFileCopy" pool for example.

Change-Id: Ie9f092fb595d12ebc6548571cecbd2f4251297db
Remove use of strencode() in buildLike()

This may cause unnecessary backslashes (in the case of a literal
% or _) to end up in the query when the DBMS uses C-style string
escaping; however, the query should still work.

Change-Id: I82681f83dd45fcbecf4bfd672f550cd4dba30949
Some improvements to Special:MergeHistory

* Added a 5000 revision limit.
* Also fixed the radio-button selection to reflect the URL
  params so the "unmerge" log link works as expected.
* Added some TODO comments.

bug: 66155
Change-Id: Ib70e9d58ae2de723b965e52c679c4e786016420e
Actually define jMY date format for Arab

Followup to I5d4a799b0 (10b6c22c45): testers failed to notice that
no new format was actually added to Special:Preferences.
Now it is and it's also used correctly e.g. in action=history
(verified by means of ctrl-c ctrl-f ctrl-v and {{#time:j M Y}}).

Bug: 65245
Change-Id: I70de62c859b9c637f989d68bc86e73113273aff8
Update documentation of what a "section" is

There are so many slightly different understandings of what a
"section" is or can be. I'm aware the documentation was improved
just a few weeks ago. I still find it incomplete and confusing.

1. I renamed it to $sectionId to make it more clear what it
really is.

2. Sections are usually numbers. 0, 1 and so on. There is no
reason to disallow the use of ints or even floats (this works
because the string representation of 0.0 is "0"). The code never
disallowed numbers.

3. 'T1' never was supported, as far as I can tell. 'T-1' is
supported. See Parser::extractSections().

4. null and false and '' all mean "the whole page" in
WikiPage::replaceSectionAtRev() but for some reason this meaning got
lost in WikitextContent::replaceSection(). I made it the same again.

Change-Id: Icc3997722d2ed742bf7703cd7c06d09199225720
Delete sr.json, it blocks messages from sr-ec

Spotted by Milićević
https://translatewiki.net/wiki/Thread:Support/Change_on_gerrit

Change-Id: I65f0ea2374012c4949e62668f8b4cc0eeab4e6af
Clarify fileexists-extension message

The message is a warning, the user can chose to ignore it, and
there are valid cases for ignoring it. However the message read
like a hard error.

Change-Id: I47693d1c08784a44b9a1360a8c2d28433b104437
Add macronless namespace aliases for Old English

Requested on Bugzilla 'for the sake of convenience.'

Bug: 58712
Change-Id: I971717a3ff72f643e1912d7fe78416db7bc8ff44
ApiExpandTemplates: Start parse before creating frame

The code added in Id12cbe4a is creating a frame from the parser object
before actually starting a parse, meaning the frame ends up with no
title, which causes problems for other stuff that assumes the frame
*does* have a title.

While we could possibly change from calling ->preprocess() to
->recursivePreprocess() to avoid re-starting the parse, there are some
hooks called from ->preprocess() that it's probably best to continue
calling to not break BC.

Bug: 66798
Change-Id: If2ca8ab94ab81ee10f33ce1f4ee75655b7c1e680
filebackend: Avoid using popen() when "parallelize" is disabled

Bug: 66467
Change-Id: Iaf8eb2ecfad166e26e265a98933399dc4bc255a3
qunit.completenessTest: Correct walkTheObject behaviour wrt breadcrumb

The function documentation states that currName is not included in
parentPathArray, although it actually is. This change makes the
implementation match the documentated behavior.

Change-Id: I6e44ad84de2e31320309438b8aa09ec929d15e8e
Make Special:TrackingCategories fully detect namespace switching

Special:TrackingCategories has special logic to detect people
using {{NAMESPACE}} in their tracking category messages, and
handle it. Make it detect any '{{' to deal with localized
variants. This will make it work for
[[commons:MediaWiki:Broken-file-category]]

Change-Id: Ibac0decc5992d30ae536efc91138ad9b42a569e9
Fixes to Special:TrackingCategories

- Message::isDisabled is using the unparsed message text, so this is
always true and not false when a #switch will return '-'.
Using a compare against '-', the same as in
Parser::addTrackingCategory.
- Title::makeTitleSafe can return null, check that
- Add 'trackingcategories-disabled' when array is empty,
this can happen when a '{{' is given, but no categories was found

Change-Id: I88322512db5c4baedc5c571ce9ccbcd0caebb61d
Make CloneDatabase error out on shared tables.

Due to the way prefixes are handled, this doesn't work properly.

Make it quit early to prevent confusion. I don't think there's
many people who need shared table support, so I don't know if
its worth the effort to actually fix.

Bug: 65654
Change-Id: I6cd701998fc9066d8c7a4fc86d93a4282cc7f9bd
Allow using wildcards for minor type in Special:MIMESearch

e.g. Allow [[Special:MIMESearch/application/*]].

Change-Id: Ic098b10a64e3346d58c94f2dbfbb552dd809e93d
Merge "Actually define jMY date format for Arab"
Merge "Add macronless namespace aliases for Old English"
Merge "Clarify fileexists-extension message"
Merge "Delete sr.json, it blocks messages from sr-ec"
mediawiki.page.image.pagination: Clean up, optimise and fix various bugs

Follows-up 427b0e1, 5e77f39.

* Remove comment stating the obvious (initialize variable).

* Unset 'xhr' variable in the success handler. This allows it to
  be freed from memory, and prevents us from uselessly trying to
  abort an already finished request.

* Rename 'xhr' to 'jqXhr' as it is not an xhr.

* Use the Promise of jQuery.ajax instead of the long-deprecated
  callback option 'success'.

* Rephrase comment stating that jQuery.load is used (which is
  not true).

* Don't re-query 'table.multipageimage' multiple times. Instead
  query it from the document once and cache it.

* Remove useless 'window.history' check. This is not a new global
  in HTML5. The 'history' global, infamous from history.go() and
  history.back(), has been a part of the web for a very long time.
  We can safely depend on them, just as we depend on 'location',
  'navigator' and 'document'.

* Add an identifier to the history pop-state to prevent an
  exception when dealing with the state object of another
  application. Lots of gadgets use the History API these days
  (as well as extensions like VisualEditor and MultimediaViewer).

* Don't store the location.href inside the pop state data. This
  is not needed because it is already stored by the browser
  natively. A history event contains a url, page title and
  custom data stored as JSON. There is no need to store the url
  again in the custom data.

* Despite the width/height transferring from the old content
  to the spinner container, the scroll position still jumped
  because it wasn't accounting for margin, padding and border.
  Use outerHeight() instead of height().

* Avoid using the DOM to store and retrieve information. Use
  application state instead of a DOM query to know whether we
  have a spinner already. This increases performance but also
  avoids false positives where (unlikely) other similar elements
  and/or spinners from a different script are on the page.

* Properly replace the entire table contents() instead of just
  dropping the <tr> straight into the emptied <table>. This way
  the script makes no assumptions about whether there is a
  caption/thead/tbody or multiple rows etc. Plus it saves another
  recursive DOM query (the one for "tr"). And fixes a potential
  bug if there are nested tables (since it was doing a recursive
  query).

Change-Id: I8b64a0860b73a5dcd8051b5e7a1fcb65107228a6