lhc/web/wiklou.git
8 years agobuild: Update grunt-contrib-jshint to v0.11.3
paladox [Thu, 3 Sep 2015 20:40:44 +0000 (21:40 +0100)]
build: Update grunt-contrib-jshint to v0.11.3

Change-Id: I2170f77042d4f31914c684bf6bdc08321abe14db

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

Change-Id: I059163c3fe6e78d77b5c83be0f2d3476f016a87c

8 years agoMerge "PrefixSearch: Avoid passing non-strings to Title::newFromText()"
jenkins-bot [Thu, 3 Sep 2015 14:58:14 +0000 (14:58 +0000)]
Merge "PrefixSearch: Avoid passing non-strings to Title::newFromText()"

8 years agoMessageCache: Don't try to log a ContentHandler object
Kunal Mehta [Thu, 3 Sep 2015 06:16:44 +0000 (23:16 -0700)]
MessageCache: Don't try to log a ContentHandler object

Change-Id: I000859370a8588b93682221d1e9fb0a2b11a4670

8 years agoPrefixSearch: Avoid passing non-strings to Title::newFromText()
Chad Horohoe [Thu, 3 Sep 2015 05:55:49 +0000 (22:55 -0700)]
PrefixSearch: Avoid passing non-strings to Title::newFromText()

We already handle the invalid title gracefully here anyway, so
just rely on that behavior and just skip the Title construction
bit :)

Bug: T109975
Change-Id: I0dc3d91b6b4cfb97664aa6ca39c5c8f086d70db5

8 years agoMerge "Avoid passing anything but a string to Title::newFromText in UploadBase::getTitle"
jenkins-bot [Thu, 3 Sep 2015 05:54:58 +0000 (05:54 +0000)]
Merge "Avoid passing anything but a string to Title::newFromText in UploadBase::getTitle"

8 years agoMerge "tests: Remove "install" target from makefile documentation"
jenkins-bot [Thu, 3 Sep 2015 05:39:16 +0000 (05:39 +0000)]
Merge "tests: Remove "install" target from makefile documentation"

8 years agoMerge "Decline to cache preprocessor items larger than 1 Mb"
jenkins-bot [Thu, 3 Sep 2015 04:52:02 +0000 (04:52 +0000)]
Merge "Decline to cache preprocessor items larger than 1 Mb"

8 years agoMerge "IEUrlExtension: Add tests for the main use case the lib exists for"
jenkins-bot [Thu, 3 Sep 2015 04:36:07 +0000 (04:36 +0000)]
Merge "IEUrlExtension: Add tests for the main use case the lib exists for"

8 years agoMerge "Support empty string for wgEmergencyContact/wgPasswordSender"
jenkins-bot [Thu, 3 Sep 2015 04:17:25 +0000 (04:17 +0000)]
Merge "Support empty string for wgEmergencyContact/wgPasswordSender"

8 years agoAvoid MessageCache rebuilds if replace() was called recently
Aaron Schulz [Sun, 30 Aug 2015 06:52:14 +0000 (23:52 -0700)]
Avoid MessageCache rebuilds if replace() was called recently

* If replace() was called recently, then we know that this is the
  master data center and that the messages are up-to-date. With this
  change, replace() calls have nothing to contend with aside from other
  replace() calls. Even if there were timeouts due to such contention,
  caused by high MediaWiki: page edit rates, the replace() updates would
  pick up the prior changes in passing since they do load().
* This also avoids the following scenario:
  a) Someone edits a message page, triggering replace()
  b) Some page view causes load() to trigger loadFromDB()
     due to the hash being seen as volatile due to replace()
  c) The loadFromDB() loads stale slave data and undoes
     the message key update the replace() did

Change-Id: I9cdf7ad3d67f168fcba7f633af9e32a8d1fa928e

8 years agoDecline to cache preprocessor items larger than 1 Mb
Ori Livneh [Thu, 3 Sep 2015 00:24:33 +0000 (17:24 -0700)]
Decline to cache preprocessor items larger than 1 Mb

This is a temporarily workaround for T111289. The data ought not be so large,
but it frequently is, and the problem is almost exclusive to this code path.
For now, just avoid attempting to cache the value if its size exceeds a million
bytes.

Bug: T111289
Change-Id: Idd1acd903193f0753cc5548bd32800705716dd9f

8 years agotests: Remove "install" target from makefile documentation
Jan Berkel [Wed, 2 Sep 2015 23:24:13 +0000 (23:24 +0000)]
tests: Remove "install" target from makefile documentation

Follows up 013c859b997.

Change-Id: I1d015993f767c2d3f82a1ce4cd62b6c09eb2e90f

8 years agoMore MessageCache locking/update cleanups
Aaron Schulz [Thu, 27 Aug 2015 08:46:05 +0000 (01:46 -0700)]
More MessageCache locking/update cleanups

* Made the status key only act as a backoff key inside
  loadFromDBWithLock(), instead of also being a lock key. The
  getReentrantScopedLock() call is now non-blocking, which has
  a similar affect to the add() call on the status key but much
  better prioritizes replace(); that method already has a blocking
  getReentrantScopedLock() call, so once it gets that lock, there
  is no worry of load() failing due to contention.
* Bail out in loadFromDBWithLock() if the scope lock was not acquired.
  Normally the status lock often assured the lock could be obtained,
  unless a competing replace() came in. The old status lock would
  cause a bail if not acquired, and this carries over that behavior
  but also avoids clobbering updates when replace() contention happens.
* Avoid calling saveToCaches() in replace() if the lock was not
  acquired to avoid clobbering conflicting writes.
* Made the loadFromDB() call in replace() use DB_MASTER to avoid
  seeing stale data if the cache is volatile.
* Lowered WAIT_SEC, as the default PHP timeout is 30.
  We want this to be able to at least finish the other calls
  in replace() even if the lock times out.
* Avoid checking the status key an extra time in load().
* Made a few small code and doc cleanups.

Change-Id: Ibaf1f67618ec374c83c3135a71e90223dd2b1856

8 years agoMerge "Fix notice when restbaseCompat is omitted"
jenkins-bot [Wed, 2 Sep 2015 21:20:07 +0000 (21:20 +0000)]
Merge "Fix notice when restbaseCompat is omitted"

8 years agoMerge "Move style to mediawiki.special.changeslist.enhanced.css"
jenkins-bot [Wed, 2 Sep 2015 21:10:24 +0000 (21:10 +0000)]
Merge "Move style to mediawiki.special.changeslist.enhanced.css"

8 years agoMerge "resourceloader: Ensure startup module returns early for incompatible browsers"
jenkins-bot [Wed, 2 Sep 2015 19:39:03 +0000 (19:39 +0000)]
Merge "resourceloader: Ensure startup module returns early for incompatible browsers"

8 years agoresourceloader: Ensure startup module returns early for incompatible browsers
Timo Tijhof [Wed, 2 Sep 2015 19:18:11 +0000 (21:18 +0200)]
resourceloader: Ensure startup module returns early for incompatible browsers

Follows-up 8491820 which refactored the code but forgot an early return.

Bug: T111233
Change-Id: Ie65427caee4231b4ca97a43394a36154c33451a9

8 years agoMerge "Localisation updates from https://translatewiki.net."
Translation updater bot [Wed, 2 Sep 2015 19:23:06 +0000 (19:23 +0000)]
Merge "Localisation updates from https://translatewiki.net."

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 2 Sep 2015 19:15:24 +0000 (21:15 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I4020a7e252903b282e37e5f6ad358f04d48de8a2

8 years agoIn phpunit don't try to write to the source directory
Tim Starling [Mon, 31 Aug 2015 22:48:27 +0000 (08:48 +1000)]
In phpunit don't try to write to the source directory

Change-Id: Id48feb0aa6a5dde10076809b58c03deaf07cf02e

8 years agoUpdate wikimedia/utfnormal to 1.0.3
Kunal Mehta [Sat, 29 Aug 2015 19:46:03 +0000 (12:46 -0700)]
Update wikimedia/utfnormal to 1.0.3

Changes since 1.0.2:
* Update repo boostrap for libraries
* Add COPYING (bug T102359)
* Ignore phpcs and travis config for export
* Added description to composer.json (bug T110795)

Change-Id: I0f976081a279561d445f1896c8ff84c38de9a697

8 years agoSync up with Parsoid parserTests.
Subramanya Sastry [Wed, 2 Sep 2015 18:00:51 +0000 (13:00 -0500)]
Sync up with Parsoid parserTests.

This now aligns with Parsoid commit 5f2fae6c7e601b706403621924b769e87c5ed554

Change-Id: Ied3e5b2ac4df059c37f8e617ae55e47e8d15c1ee

8 years agoMove style to mediawiki.special.changeslist.enhanced.css
umherirrender [Wed, 2 Sep 2015 16:46:43 +0000 (18:46 +0200)]
Move style to mediawiki.special.changeslist.enhanced.css

One rule is just used on enhanced changelist, therefore move it from
shared.css/oldshared.css to mediawiki.special.changeslist.enhanced.css

Change-Id: Ib19defab36889f6a99599bdcab02f88bcec344a1

8 years agoMerge "mediawiki.Uri: Use extended RegExps through templates"
jenkins-bot [Wed, 2 Sep 2015 17:57:26 +0000 (17:57 +0000)]
Merge "mediawiki.Uri: Use extended RegExps through templates"

8 years agoMerge "Remove references to Popularpages alias"
jenkins-bot [Wed, 2 Sep 2015 17:00:21 +0000 (17:00 +0000)]
Merge "Remove references to Popularpages alias"

8 years agoMerge "Fix comment in mediawiki.page.gallery.css"
jenkins-bot [Wed, 2 Sep 2015 16:19:12 +0000 (16:19 +0000)]
Merge "Fix comment in mediawiki.page.gallery.css"

8 years agoFix comment in mediawiki.page.gallery.css
umherirrender [Wed, 2 Sep 2015 16:08:18 +0000 (18:08 +0200)]
Fix comment in mediawiki.page.gallery.css

It no longer has styles in commonPrint.css

Follow-Up: Ib1aef04dc4fece78e6615386ecaef6a9f368f49e
Change-Id: If3446e656456b9d0142a368bd24685520316d2a1

8 years agoMerge "mediawiki.special.upload: Use jquery.spinner properly, instead of only its...
jenkins-bot [Wed, 2 Sep 2015 15:56:05 +0000 (15:56 +0000)]
Merge "mediawiki.special.upload: Use jquery.spinner properly, instead of only its CSS classes"

8 years agoRemove non-existing param PHPDoc tag from Title
Thiemo Mättig [Wed, 2 Sep 2015 12:16:59 +0000 (14:16 +0200)]
Remove non-existing param PHPDoc tag from Title

Change-Id: Ie05be75b3e1a20e241206fdae8d1496fcbffeaae

8 years agoMerge "ApiLogin: Don't try to add block info if there's no block"
jenkins-bot [Wed, 2 Sep 2015 14:23:14 +0000 (14:23 +0000)]
Merge "ApiLogin: Don't try to add block info if there's no block"

8 years agoMerge "Allow stop characters as quoted attribute delimiters"
jenkins-bot [Wed, 2 Sep 2015 13:27:37 +0000 (13:27 +0000)]
Merge "Allow stop characters as quoted attribute delimiters"

8 years agoApiLogin: Don't try to add block info if there's no block
Brad Jorsch [Wed, 2 Sep 2015 13:14:20 +0000 (09:14 -0400)]
ApiLogin: Don't try to add block info if there's no block

Extensions such as CentralAuth can use various hooks to return
USER_BLOCKED or CREATE_BLOCKED despite there being no local block.

Bug: T111082
Change-Id: I3433a35547967852fc30bd56274392a186004a38

8 years agoMerge "resourceloader: Use increment() for resourceloader_cache miss metric"
jenkins-bot [Wed, 2 Sep 2015 12:23:45 +0000 (12:23 +0000)]
Merge "resourceloader: Use increment() for resourceloader_cache miss metric"

8 years agoSupport empty string for wgEmergencyContact/wgPasswordSender
Timo Tijhof [Mon, 31 Aug 2015 15:32:56 +0000 (17:32 +0200)]
Support empty string for wgEmergencyContact/wgPasswordSender

In previous versions, the installer often outputted the following
in the generated LocalSettings.php:
> $wgEmergencyContact = '';
> $wgPasswordSender = '';

While this case did not result in providing default values in recent
MediaWiki versions, the mail handling didn't cause an error.

As of MediaWiki 1.25, the error handling is more strict and these
values being empty causes a fatal error and breaks all outgoing mail.

Bug: T104142
Change-Id: Ibf1f857b2f250dac9b725aff8f442e08b8ecd5c9

8 years agomediawiki.Upload: Consistently use getters rather than direct property access
Bartosz Dziewoński [Wed, 2 Sep 2015 11:15:31 +0000 (13:15 +0200)]
mediawiki.Upload: Consistently use getters rather than direct property access

Using this.text instead of this.getText() in this.upload() resulted in the
text of mw.ForeignStructuredUpload being entirely ignored. Fix this
and other properties too for consistency.

Change-Id: I8282260474f4e7d010766be3f2a7ba8641313571

8 years agoresourceloader: Use increment() for resourceloader_cache miss metric
Timo Tijhof [Tue, 1 Sep 2015 19:15:53 +0000 (21:15 +0200)]
resourceloader: Use increment() for resourceloader_cache miss metric

This makes it consistent with how we handle the resourceloader_cache hit metric.

When I added the miss metric I figured it was nice to get both counts and timings
in a single metric, but I can't trust StatsD/Graphite not to screw this up so
let's untangle them to be sure.

Change-Id: I24f68e34a9fa491806fdb6023bdd757f6688c2ed

8 years agoFix notice when restbaseCompat is omitted
Matthew Flaschen [Wed, 2 Sep 2015 03:50:05 +0000 (23:50 -0400)]
Fix notice when restbaseCompat is omitted

Change-Id: I61042b326b989a4e3250f4a170d76048bdafcbd3

8 years agoMerge "Implement wfArrayPlus2d which combines 2d arrays"
jenkins-bot [Wed, 2 Sep 2015 03:31:10 +0000 (03:31 +0000)]
Merge "Implement wfArrayPlus2d which combines 2d arrays"

8 years agoMerge "Update OOjs UI to v0.12.7"
jenkins-bot [Tue, 1 Sep 2015 23:57:43 +0000 (23:57 +0000)]
Merge "Update OOjs UI to v0.12.7"

8 years agoMerge "Deprecate unconditional loading of mediawiki.ui.button on all pages"
jenkins-bot [Tue, 1 Sep 2015 23:46:18 +0000 (23:46 +0000)]
Merge "Deprecate unconditional loading of mediawiki.ui.button on all pages"

8 years agoUpdate OOjs UI to v0.12.7
James D. Forrester [Tue, 1 Sep 2015 23:31:54 +0000 (16:31 -0700)]
Update OOjs UI to v0.12.7

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

Change-Id: Iea667a717e4694e28fcfafdc7111076682cc6a4a

8 years agoMerge "Reword 'stub-threshold' message in Special:Preferences advanced section"
jenkins-bot [Tue, 1 Sep 2015 23:25:19 +0000 (23:25 +0000)]
Merge "Reword 'stub-threshold' message in Special:Preferences advanced section"

8 years agoMerge "Link DB docs from tables.sql"
jenkins-bot [Tue, 1 Sep 2015 22:21:43 +0000 (22:21 +0000)]
Merge "Link DB docs from tables.sql"

8 years agoMerge "Language: Fix 'pretty' fallback in getDateFormatString()"
jenkins-bot [Tue, 1 Sep 2015 22:16:20 +0000 (22:16 +0000)]
Merge "Language: Fix 'pretty' fallback in getDateFormatString()"

8 years agoLink DB docs from tables.sql
Matthew Flaschen [Tue, 1 Sep 2015 22:11:19 +0000 (18:11 -0400)]
Link DB docs from tables.sql

Change-Id: I720ae3345963414103112fd4b4d2128c569999c2

8 years agoLanguage: Fix 'pretty' fallback in getDateFormatString()
Kunal Mehta [Tue, 1 Sep 2015 17:19:24 +0000 (10:19 -0700)]
Language: Fix 'pretty' fallback in getDateFormatString()

* If using 'default', still fallback to 'date' if 'pretty' is
unavailable.
* Fix instance caching of 'default', which never worked since $pref
would be changed inside the !isset() block.

Bug: T110945
Change-Id: Ic53b279f8741371fa1cb642c53e6d487cb1c6b81

8 years agoMerge "Use wgResourceBasePath instead of wgScriptPath for wgStylePath etc."
jenkins-bot [Tue, 1 Sep 2015 21:55:31 +0000 (21:55 +0000)]
Merge "Use wgResourceBasePath instead of wgScriptPath for wgStylePath etc."

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 1 Sep 2015 19:26:51 +0000 (21:26 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ie07f3d57d81c5b1f645c95397f10a31f18c5d6d1

8 years agoDeprecate unconditional loading of mediawiki.ui.button on all pages
Ori Livneh [Tue, 1 Sep 2015 18:40:27 +0000 (11:40 -0700)]
Deprecate unconditional loading of mediawiki.ui.button on all pages

Formally deprecate the unconditional loading of mediawiki.ui.button on all
pages. During the deprecation period, the styles will be loaded on pages which
contain 'mw-ui-button' in the page HTML. Starting with 1.28, the styles will
only be loaded if explicitly depended upon.

The rationale for the patch was expressed by Spage in a comment on PS4 of
I835f3eb937: "Wikis have too many templates like
[[commons:Template:Clickable_button]] dependent on jquery.ui.button that don't
work if JavaScript isn't enabled.  mediawiki.ui.button is a lighter-weight
piece of CSS that we own and can improve, and transitioning wiki content to it
requires that we provide it." Mattflaschen commented that the added payload was
"justifiable if we announce this widely and make an effort to get wikis to use this."

A year and a half later, [[commons:Template:Clickable_button]] is still not
using mediawiki.ui.button, and usage elsewhere is not sufficiently widespread
to merit loading this stylesheet in the critical path.

Bug: T98395
Change-Id: I290e1db422b7c7b9c1a026aae22e174580cefae9

8 years agoImplement wfArrayPlus2d which combines 2d arrays
Florian [Thu, 27 Aug 2015 17:49:50 +0000 (19:49 +0200)]
Implement wfArrayPlus2d which combines 2d arrays

Moved the logic of ExtensionRegistrations array_plus_2d merge method out
to it's own global function wfArrayPlus2d, so any other function in mediawiki
core and it's extensions can use this method when they need to union
a 2d array.

Change-Id: I56afdf306e399a4a1505828ed76c60c1bfd033b6

8 years agoMerge "EditPage: Add text placeholders to view source page"
jenkins-bot [Tue, 1 Sep 2015 16:45:58 +0000 (16:45 +0000)]
Merge "EditPage: Add text placeholders to view source page"

8 years agoresourceloader: Remove redundant type-checks in internal code
Timo Tijhof [Fri, 28 Aug 2015 23:12:07 +0000 (01:12 +0200)]
resourceloader: Remove redundant type-checks in internal code

The private 'execute()' method only runs for modules that have been
implemented by mw.loader.implement, which already throws if 'messages'
or 'style' is set to a non-object value.

The execute() code for 'templates' already has this check removed.

Change-Id: I65b8a87500388d3d2ca6e495e1e50179639ba27a

8 years agoMerge "resourceloader: Consistently set state=ready after script execution (not before)"
jenkins-bot [Tue, 1 Sep 2015 16:32:11 +0000 (16:32 +0000)]
Merge "resourceloader: Consistently set state=ready after script execution (not before)"

8 years agoMerge "Add ForeignUpload and ForeignStructuredUpload"
jenkins-bot [Tue, 1 Sep 2015 16:27:31 +0000 (16:27 +0000)]
Merge "Add ForeignUpload and ForeignStructuredUpload"

8 years agoresourceloader: Consistently set state=ready after script execution (not before)
Timo Tijhof [Fri, 28 Aug 2015 22:56:24 +0000 (00:56 +0200)]
resourceloader: Consistently set state=ready after script execution (not before)

For the case of 'module.script' being an array, mw.loader already sets state=ready
after execution. For the cases of it being a function or string, we were setting
state=ready before execution.

This looks like it may have intended to prevent double execution where e.g.
some other module may need this module and see it has state 'loading' and start
executing it. However ResourceLoader doesn't expose execute(). The only code
calling execute() is code that also sets 'state=loading', or handlePending.

In fact, this early setting of "ready" could actually cause double execution.
Not of the current module, but of dependent modules. If a module's script loads
other modules that are cache hits, that could may trigger handlePending() which
will assume the current module to be ready, when it isn't.

Now that these code paths match, re-use the markModuleReady callback instead of
repeating this code.

Update tests:
* Make assertion captions less verbose.
* Change load instruction from "test.implement" to "test.implement.import".
  Module "test.implement" doesn't exist. This worked by accident because
  implement() can sometimes run a module immediately if it doesn't exist.
* Update test to reflect internal detail that state=loading during script
  execution.
* Assert afterwards that script ran and state=ready.

Change-Id: I6b0542edb113d58b8f24cc8587e98ee88b514c55

8 years agoUse wgResourceBasePath instead of wgScriptPath for wgStylePath etc.
Timo Tijhof [Tue, 1 Sep 2015 16:13:02 +0000 (18:13 +0200)]
Use wgResourceBasePath instead of wgScriptPath for wgStylePath etc.

This make re-configuring these much easier by only needing to update
one variable instead of four.

Also remove redundant hardcoding of wgStylePath and wgResourceBasePath
in the generated LocalSettings.php file during installation. This way
changing wgScriptPath will naturally result in the other variables
updating too. We already do this for many other variables (such as
wgLoadScript, wgScript, wgExtensionAssetsPath, etc.).

Change-Id: Ide74355b4054c78214c17f3b2d6fa2f5270e0ab9

8 years agoAdd ForeignUpload and ForeignStructuredUpload
Mark Holmquist [Wed, 26 Aug 2015 19:42:21 +0000 (14:42 -0500)]
Add ForeignUpload and ForeignStructuredUpload

These classes will be used to send uploads from one wiki to another,
and the latter includes (partial) adherence to the Commons structured
data system [0].

[0] https://commons.wikimedia.org/wiki/Commons:Structured_data

Change-Id: I96fcb862eb854d23b6f9f553a87fa7ca65bf5a93
Bug: T105071

8 years agoIgnore languages/messages/Messages*.php in line length sniff
Vivek Ghaisas [Tue, 25 Aug 2015 20:27:41 +0000 (01:57 +0530)]
Ignore languages/messages/Messages*.php in line length sniff

Most of these files have very long lines, but that makes them easier to
read. Also, they're generated from a script. It's probably a better idea
to ignore their lengths than to change the lengths.

Bug: T103806
Change-Id: Ic6860520e4cc76f93aa13c364aae11cf14f279d0

8 years agoMerge "Make readonly work for OOUI forms"
jenkins-bot [Tue, 1 Sep 2015 12:51:26 +0000 (12:51 +0000)]
Merge "Make readonly work for OOUI forms"

8 years agoEditPage: Add text placeholders to view source page
Derk-Jan Hartman [Mon, 24 Aug 2015 20:58:33 +0000 (22:58 +0200)]
EditPage: Add text placeholders to view source page

These placeholders are already in use by the edit form, but were not
available to extensions. This gives us equal oppertunity to adapt the
contents surrounding the source textbox as we have in the editform.

I'm reusing the same placeholders. Most extensions fill these
placeholders through the showEditForm:initial hook however, so it
should not cause too many unexpected changes, since the readonly page
uses showReadOnlyForm:initial instead. I left out those that were very
specific to the editpage (afterEditTools etc).

This will be useful for Bug T110050.

Change-Id: Ia03265a907212ee7bac1b839dcdd4d2f24c79bbe

8 years agoMake readonly work for OOUI forms
Glaisher [Tue, 1 Sep 2015 12:37:54 +0000 (17:37 +0500)]
Make readonly work for OOUI forms

This seems like a hack. Copied from HTMLTextField.

Change-Id: I46f3dbd4b60fd9a39ecd7167ec903ae7d1d804bc

8 years agomediawiki.Uri: Use extended RegExps through templates
Bartosz Dziewoński [Tue, 25 Aug 2015 07:43:38 +0000 (09:43 +0200)]
mediawiki.Uri: Use extended RegExps through templates

JavaScript does not support the 'x' RegExp option for 'extended'
RegExps, or named capturing groups, which makes it impossible to write
large RegExps in a readable way. OR DOES IT?!?

Cons:
* Small runtime performance loss to convert to regular RegExp
* Worse minification due to unminifiable whitespace
    (Both of these problems could probably me resolved
     if we moved the processing server-side somehow,
     but there's no support for it in ResourceLoader now)

Pros:
* You can actually somewhat understand the bloody things if you care
  to, unlike before.

YMMV:
* The actual regexps are in different files

Change-Id: I41630bf20cdb5c2936d85d9f831f2aa7bb8cfef1

8 years agoresourceloader: Don't add "&*" query parameter to load.php urls
Timo Tijhof [Fri, 28 Aug 2015 12:00:58 +0000 (14:00 +0200)]
resourceloader: Don't add "&*" query parameter to load.php urls

Follows-up r88883 (8dab43f703). The IEUrlExtension library only considers the
query string if the base path has no extension (or if the dot is urlencoded).
Neither of which is the case for load.php urls.

If the server doesn't expose undecoded request URIs (per IEUrlExtension)
then it will look in the query string always. However even then it is
only an issue if the last query parameter in the url contains a dot,
which is very unlikely for load.php (they typically end in 'skin' or
'version' which don't contain plain dots).

Ref T30840.

Change-Id: I4a4ef7ef5ad7d74ecb47a44342e6324fa9844173

8 years agoMerge "Fixed and suppressed some thumb.php IDEA errors"
jenkins-bot [Tue, 1 Sep 2015 00:45:12 +0000 (00:45 +0000)]
Merge "Fixed and suppressed some thumb.php IDEA errors"

8 years agoMerge "Clarified WANObjectCache::delete() comments"
jenkins-bot [Tue, 1 Sep 2015 00:44:09 +0000 (00:44 +0000)]
Merge "Clarified WANObjectCache::delete() comments"

8 years agoMerge "Allow to export null values"
jenkins-bot [Mon, 31 Aug 2015 23:01:26 +0000 (23:01 +0000)]
Merge "Allow to export null values"

8 years agoAllow to export null values
Stanislav Malyshev [Mon, 31 Aug 2015 22:45:06 +0000 (15:45 -0700)]
Allow to export null values

Bug: T110960
Change-Id: Idd90c8b6370547b1d9caa8b93e3d5b27942418d8

8 years agoMerge "resourceloader: Improve moduleRegistry documentation"
jenkins-bot [Mon, 31 Aug 2015 21:20:16 +0000 (21:20 +0000)]
Merge "resourceloader: Improve moduleRegistry documentation"

8 years agoMerge "resourceloader: Remove global startUp() callback"
jenkins-bot [Mon, 31 Aug 2015 21:10:50 +0000 (21:10 +0000)]
Merge "resourceloader: Remove global startUp() callback"

8 years agoMerge "objectcache: Correct tempTTL comment for getWithSetCallback()"
jenkins-bot [Mon, 31 Aug 2015 21:01:26 +0000 (21:01 +0000)]
Merge "objectcache: Correct tempTTL comment for getWithSetCallback()"

8 years agoobjectcache: Correct tempTTL comment for getWithSetCallback()
Aaron Schulz [Mon, 31 Aug 2015 20:35:09 +0000 (13:35 -0700)]
objectcache: Correct tempTTL comment for getWithSetCallback()

* This applies regardless of lockTSE

Change-Id: I5adb62fbb956407cd978211a0497e8bd9de3c1a5

8 years agoClarified WANObjectCache::delete() comments
Aaron Schulz [Mon, 31 Aug 2015 20:26:22 +0000 (13:26 -0700)]
Clarified WANObjectCache::delete() comments

Change-Id: I8c1cffa284cf92461045f9163ff1d1e9bf8c2244

8 years agoRemoved READ_LATEST from revision load in getMsgFromNamespace()
Aaron Schulz [Wed, 26 Aug 2015 23:13:49 +0000 (16:13 -0700)]
Removed READ_LATEST from revision load in getMsgFromNamespace()

* The key salting of the invidial keys via the WAN cache makes
  it OK to use slaves here. The salting happens via the delete()
  in the MessageCache::replace() call, which is hit when the
  message page is edited.

Bug: T92357
Change-Id: Ic191f6c3fc49c4c58461d26468dd0fa94a52051e

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 31 Aug 2015 20:05:26 +0000 (22:05 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I734ddd0b235fdfc0983bad6683f8e90367862177

8 years agoMerge "Changing user and user talk namespace name for Latvian wikis"
jenkins-bot [Mon, 31 Aug 2015 19:56:11 +0000 (19:56 +0000)]
Merge "Changing user and user talk namespace name for Latvian wikis"

8 years agoMerge "Don't free the parser in the catch() block of parse()"
jenkins-bot [Mon, 31 Aug 2015 19:30:44 +0000 (19:30 +0000)]
Merge "Don't free the parser in the catch() block of parse()"

8 years agoFixed and suppressed some thumb.php IDEA errors
Aaron Schulz [Wed, 26 Aug 2015 19:19:50 +0000 (12:19 -0700)]
Fixed and suppressed some thumb.php IDEA errors

Change-Id: If5ec6fd1d6d272633296b74d2d8e146feb924229

8 years agoresourceloader: Improve moduleRegistry documentation
Timo Tijhof [Fri, 28 Aug 2015 22:54:27 +0000 (00:54 +0200)]
resourceloader: Improve moduleRegistry documentation

Rename local 'msgs' variable to 'messages' for consistency.

Change-Id: I5d035204ac5d22673a9b9a68ce9ea6cf23aaeba8

8 years agoresourceloader: Remove global startUp() callback
Timo Tijhof [Fri, 28 Aug 2015 22:20:53 +0000 (00:20 +0200)]
resourceloader: Remove global startUp() callback

Instead of a hardcoded JSONP-style global callback, use script
load handlers. This uses the same logic as jQuery uses internally
(ajax/script.js), which we call inside mediawiki.js. Inline those
two lines here since this the code is what loads jQuery itself.

Bug: T39894
Change-Id: I02b0d16a6ec3081dc551bfd9c3ae652707b7edcf

8 years agoComment typo fix
Brad Jorsch [Mon, 31 Aug 2015 14:32:06 +0000 (10:32 -0400)]
Comment typo fix

Change-Id: I52e36f1ecbef8e8c18066d3dde84bda086ef9808

8 years agoMerge "Rephrase tooltip-t-contributions for better grammar"
jenkins-bot [Mon, 31 Aug 2015 13:02:23 +0000 (13:02 +0000)]
Merge "Rephrase tooltip-t-contributions for better grammar"

8 years agoChanging user and user talk namespace name for Latvian wikis
maurelio [Mon, 31 Aug 2015 12:21:25 +0000 (14:21 +0200)]
Changing user and user talk namespace name for Latvian wikis

Added too GENDER support and kept the old NS_USER and NS_USER_TALK values
as $namespacealiases

Bug: T106513
Change-Id: Ibabbf284c5b5fef982d332d3dd5fd06fa76a69dd

8 years agoSkip monolog tests if monolog is not installed
Kunal Mehta [Mon, 31 Aug 2015 06:42:56 +0000 (23:42 -0700)]
Skip monolog tests if monolog is not installed

Change-Id: Ib3f4f76651da183901634a0ac6787666e47d74d4

8 years agoMerge "Workaround fopen lack of SubjectAltName support for instantCommons"
jenkins-bot [Mon, 31 Aug 2015 00:28:44 +0000 (00:28 +0000)]
Merge "Workaround fopen lack of SubjectAltName support for instantCommons"

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 30 Aug 2015 18:56:08 +0000 (20:56 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I234526fd75bd75e927c3891988f82081dd05131e

8 years agoMerge "Improve wording of "size-bytes" and "size-pixel" messages"
jenkins-bot [Sun, 30 Aug 2015 07:35:34 +0000 (07:35 +0000)]
Merge "Improve wording of "size-bytes" and "size-pixel" messages"

8 years agoReword 'stub-threshold' message in Special:Preferences advanced section
This, that and the other [Sun, 30 Aug 2015 07:28:44 +0000 (17:28 +1000)]
Reword 'stub-threshold' message in Special:Preferences advanced section

Message changed from "Threshold for stub link formatting bytes" to
"Threshold in bytes for stub link rendering (sample)".

Also convert it to a wikitext message (not raw HTML) and improve the "qqq"
documentation.

Bug: T107732
Change-Id: I493679073b9881c98a068dede2db00b391ab8353

8 years agoImprove wording of "size-bytes" and "size-pixel" messages
This, that and the other [Sun, 30 Aug 2015 05:23:13 +0000 (15:23 +1000)]
Improve wording of "size-bytes" and "size-pixel" messages

"B" and "P" are vanishingly rare abbreviations for "bytes" and "pixels"
respectively. Let's use the full English terms for these, combined with
a PLURAL magic word for good measure.

Change-Id: Id59c4b9dea2c13940ae790b6a236ac08abe0a768

8 years agoWorkaround fopen lack of SubjectAltName support for instantCommons
Brian Wolff [Wed, 1 Jul 2015 08:15:39 +0000 (02:15 -0600)]
Workaround fopen lack of SubjectAltName support for instantCommons

Hacky work around, where on php < 5.6.0 where SubjectAltName is not
supported, if a request to commons.wikimedia.org fails, retry the
request but telling php fopen wrapper to treat it as if it came
from en.wikipedia.org for validation purposes, since as of
c02fab71422a that's what the common name of the cert will be.

In the ideal world, everyone would just have curl installed.

I know this is super hacky, but I'd really like instant commons to
work out of the box even without curl installed.

Note: I'm basing the php 5.6 part on documentation, I have not tested
this with a copy of that version of php.

Bug: T75199
Change-Id: Ibde59be61a5b3d7cd5397ba352dce9be11e1b06f

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 29 Aug 2015 19:33:15 +0000 (21:33 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I11090b4bd770e52ee751b31b3788189e8d40c3f4

8 years agomediawiki.ForeignApi: Use `type === 'POST'` instead of `type !== 'GET'`
Bartosz Dziewoński [Sat, 29 Aug 2015 18:44:08 +0000 (20:44 +0200)]
mediawiki.ForeignApi: Use `type === 'POST'` instead of `type !== 'GET'`

Works better when 'type' is not set (which can happen if someone is
calling #ajax directly rather than #get or #post), is consistent
with code in mediawiki.api, and better reflects what we really mean.

Change-Id: Iea265be5c0e6113e91e700124ac36a0b588ca25c

8 years agoAdd protected getCurrentRow to TablePager
addshore [Sat, 29 Aug 2015 12:08:44 +0000 (14:08 +0200)]
Add protected getCurrentRow to TablePager

This makes unit testing TablePagers easier

Change-Id: I899ec6b056fb1f007a6caf0be320324cffe08326

8 years agoReally actually fix the typo in Parser.php
Kunal Mehta [Sat, 29 Aug 2015 04:39:15 +0000 (21:39 -0700)]
Really actually fix the typo in Parser.php

Change-Id: I9d9c6f13095087ac2c2c6693c6bd1613219bf658

8 years agoFixed parser report typo
Aaron Schulz [Sat, 29 Aug 2015 00:06:45 +0000 (17:06 -0700)]
Fixed parser report typo

Change-Id: Ia549f4e1932bc1196e840e154b8d6fb0b608d10d

8 years agoMerge "Improved getMainStashInstance() docs"
jenkins-bot [Sat, 29 Aug 2015 00:01:58 +0000 (00:01 +0000)]
Merge "Improved getMainStashInstance() docs"

8 years agoMade MessageCache use the WAN cache for individual cache keys
Aaron Schulz [Thu, 27 Aug 2015 09:10:03 +0000 (02:10 -0700)]
Made MessageCache use the WAN cache for individual cache keys

* These keys are used for larger messages not in the main blob,
  and they still use explicit purges as the pages change

Change-Id: I254ddcc9ffe7c49654788d6aabcca2ab7ed4f03f

8 years agoImproved getMainStashInstance() docs
Aaron Schulz [Fri, 28 Aug 2015 23:24:13 +0000 (16:24 -0700)]
Improved getMainStashInstance() docs

Change-Id: I49e5c112478927387244214917fb06907c22186f

8 years agoMerge "Localisation updates from https://translatewiki.net."
Translation updater bot [Fri, 28 Aug 2015 19:59:26 +0000 (19:59 +0000)]
Merge "Localisation updates from https://translatewiki.net."

8 years agoMerge "Revert "Prevent the jumbling up of autocomments in RTL""
jenkins-bot [Fri, 28 Aug 2015 19:35:20 +0000 (19:35 +0000)]
Merge "Revert "Prevent the jumbling up of autocomments in RTL""