lhc/web/wiklou.git
8 years agomediawiki.jqueryMsg: Strip leading colon in wikilinks
Bartosz Dziewoński [Wed, 7 Oct 2015 18:16:30 +0000 (20:16 +0200)]
mediawiki.jqueryMsg: Strip leading colon in wikilinks

Strip leading ':', which is used to suppress special behavior in
wikitext links, e.g. [[:Category:Foo]] or [[:File:Foo.jpg]].

Also added tests for empty wikilinks.

Bug: T114130
Change-Id: Idc78310d6106c2badc0fde933f901d672556ab26

8 years agoMerge "API: Add ApiQueryAllRevisions"
jenkins-bot [Wed, 7 Oct 2015 16:38:35 +0000 (16:38 +0000)]
Merge "API: Add ApiQueryAllRevisions"

8 years agoMerge "Make WikiMap fall back to sites if a site couldn't be found using $wgConf"
jenkins-bot [Wed, 7 Oct 2015 16:25:50 +0000 (16:25 +0000)]
Merge "Make WikiMap fall back to sites if a site couldn't be found using $wgConf"

8 years agoMerge "Return log id for file deletions"
jenkins-bot [Wed, 7 Oct 2015 16:19:06 +0000 (16:19 +0000)]
Merge "Return log id for file deletions"

8 years agoMerge "Use ForeignFileRepo information for foreign uploads"
jenkins-bot [Wed, 7 Oct 2015 16:05:58 +0000 (16:05 +0000)]
Merge "Use ForeignFileRepo information for foreign uploads"

8 years agoUse ForeignFileRepo information for foreign uploads
Mark Holmquist [Tue, 6 Oct 2015 18:13:13 +0000 (13:13 -0500)]
Use ForeignFileRepo information for foreign uploads

This seems like a (slightly) cleaner system. We'll need to change
some documentation and add some configuration, but at least this will
be easier to handle.

Bug: T114765
Change-Id: If962fd3066e25e43e745efd29058eae82195bfb1

8 years agoMerge "Bump WANObjectCache::LOW_TTL to 30"
jenkins-bot [Wed, 7 Oct 2015 15:35:10 +0000 (15:35 +0000)]
Merge "Bump WANObjectCache::LOW_TTL to 30"

8 years agoMerge "Small optimization for FileContentsHasher"
jenkins-bot [Wed, 7 Oct 2015 15:25:58 +0000 (15:25 +0000)]
Merge "Small optimization for FileContentsHasher"

8 years agoReturn log id for file deletions
Brad Jorsch [Wed, 7 Oct 2015 14:19:36 +0000 (10:19 -0400)]
Return log id for file deletions

WikiPage::doDeleteArticleReal returns the log id as the value of the
returned Status object, and ApiDelete depends on this. ApiDelete is also
expecting FileDeleteForm::doDelete to do the same, so let's make it
happen.

Bug: T114893
Change-Id: Ia887d88f16378134924d122dad6c17c8a981f0e6

8 years agoMake WikiMap fall back to sites if a site couldn't be found using $wgConf
Marius Hoch [Thu, 1 Oct 2015 10:57:25 +0000 (12:57 +0200)]
Make WikiMap fall back to sites if a site couldn't be found using $wgConf

The mapping is not very good, but should be good enough, given
that only the URL parts are really being used.

Bug: T114107
Change-Id: I8186140aed5620cf7b4ba84aa4c9492c61f406d0

8 years agoMerge "Pass the search term into the SpecialSearchResultsAppend hook"
jenkins-bot [Wed, 7 Oct 2015 10:37:50 +0000 (10:37 +0000)]
Merge "Pass the search term into the SpecialSearchResultsAppend hook"

8 years agoBump WANObjectCache::LOW_TTL to 30
Aaron Schulz [Wed, 7 Oct 2015 06:50:24 +0000 (23:50 -0700)]
Bump WANObjectCache::LOW_TTL to 30

This better handles values that take a long time to
generate. For example if it took 10 sec, then the old
value would not regenerate in time. 30 is a good, high,
value that is the default PHP timeout.

Change-Id: I2e4372bf4c6d28d09347012926d8c0a9deda4183

8 years agoClean up BagOStuff::get() interface
Aaron Schulz [Sun, 4 Oct 2015 05:59:38 +0000 (22:59 -0700)]
Clean up BagOStuff::get() interface

* Callers of get() no longer have to contend with
  the annoying $casToken parameter, which is there
  but totally unusable to non-BagOStuff code.
* The default get() now delegates to doGet(),
  which callers must implement instead. They can
  ignore the overhead of generating $casToken if
  they do not implement cas(), which applies to
  callers that use the stock merge(). If cas() is
  used for merge(), then getWithToken() must be
  implemented.
* Also add BagOStuff::READ_LATEST to mergeViaCas()
  for sanity, as that missing before.
  Likewise with mergeViaLock().

Change-Id: I4efce6a9ab4b1eadd2f161dff641004a7239c516

8 years agoMerge "Remove begin/commit from recordOldUpload()"
jenkins-bot [Wed, 7 Oct 2015 02:45:27 +0000 (02:45 +0000)]
Merge "Remove begin/commit from recordOldUpload()"

8 years agoMerge "Move WebRequestUpload class to its own file"
jenkins-bot [Wed, 7 Oct 2015 02:36:14 +0000 (02:36 +0000)]
Merge "Move WebRequestUpload class to its own file"

8 years agoMerge "Remove begin/commit from recordUpload2()"
jenkins-bot [Wed, 7 Oct 2015 02:31:39 +0000 (02:31 +0000)]
Merge "Remove begin/commit from recordUpload2()"

8 years agoRemove begin/commit from recordOldUpload()
Aaron Schulz [Tue, 6 Oct 2015 18:10:33 +0000 (11:10 -0700)]
Remove begin/commit from recordOldUpload()

* The only caller already has has transaction via lock/unlock
  and does the file operations first (avoiding contention)
* Also made recordOldUpload() protected

Change-Id: Ib03ca76895a181ed513a289e2b44f6b97e4a1bc0

8 years agoMove WebRequestUpload class to its own file
Timo Tijhof [Wed, 7 Oct 2015 02:24:58 +0000 (19:24 -0700)]
Move WebRequestUpload class to its own file

Moving out of WebRequest.php. It's not even a subclass.

Change-Id: I87e5c01afe215a084e39b442c65d22d9d0cc1015

8 years agoMerge "Fix AssembleUploadChunksJob/PublishStashedFileJob IDEA errors"
jenkins-bot [Wed, 7 Oct 2015 02:18:43 +0000 (02:18 +0000)]
Merge "Fix AssembleUploadChunksJob/PublishStashedFileJob IDEA errors"

8 years agoMerge "Lower CDN cache TTL when slave lag is high"
jenkins-bot [Wed, 7 Oct 2015 02:01:34 +0000 (02:01 +0000)]
Merge "Lower CDN cache TTL when slave lag is high"

8 years agoUpdate more docs and type hints to use IDatabase
Aaron Schulz [Tue, 6 Oct 2015 05:39:37 +0000 (22:39 -0700)]
Update more docs and type hints to use IDatabase

Change-Id: I8c8d85b32a8aba21e14d2a2dde4c25eb509186c1

8 years agoLower CDN cache TTL when slave lag is high
Aaron Schulz [Thu, 1 Oct 2015 07:24:18 +0000 (00:24 -0700)]
Lower CDN cache TTL when slave lag is high

* $wgCdnMaxageLagged controls exactly what that TTL is
  and the usual "max lag" settings determine what "high"
  is for lag (which already makes the site read-only).
* This helps avoids stale content getting stuck in CDN
  for a month just because a slave was lagged for a minute.
  Of course race conditions with normal slave lag and WAN
  cache relay purges can still lead to this problem, though
  the scope of it is reduced.

Bug: T113204
Change-Id: I7ff0a8d88665f4e557566e7b412e75edee2627fe

8 years agoMerge "Enforce lagged-slave read-only mode on the DB layer"
jenkins-bot [Wed, 7 Oct 2015 01:40:34 +0000 (01:40 +0000)]
Merge "Enforce lagged-slave read-only mode on the DB layer"

8 years agoAdd MemoizedCallable for APC-backed function memoization
Ori Livneh [Mon, 5 Oct 2015 23:10:56 +0000 (16:10 -0700)]
Add MemoizedCallable for APC-backed function memoization

Add a simple class to `libs/` for memoizing functions by caching return values
in APC. I decided not to make this an external library just yet because I see
this as potentially a part of a larger functional programming library.

Doesn't use APCBagOStuff for two reasons: (1) avoid dependency on MediaWiki
code; (2) ability to pass third &$success parameter to apc_store, to
distinguish between cache misses and cached false values.

Use this in ResourceLoaderFileModule to cache CSSMin::remap.

Change-Id: I00a47983a2583655d4631ecc9c6ba17597e36b5f

8 years agoMerge "Restore "userAgent" MultiHttpClient constructor override"
jenkins-bot [Tue, 6 Oct 2015 23:15:58 +0000 (23:15 +0000)]
Merge "Restore "userAgent" MultiHttpClient constructor override"

8 years agoRestore "userAgent" MultiHttpClient constructor override
Aaron Schulz [Tue, 6 Oct 2015 22:26:59 +0000 (15:26 -0700)]
Restore "userAgent" MultiHttpClient constructor override

This is more convenient than needing to set it on each
HTTP request. Also, it is still documented as being there.

Change-Id: I246c9c3861d72701c844200b82d1a38a0c301795

8 years agoMerge "Fix duplicate automatic file backend bug"
jenkins-bot [Tue, 6 Oct 2015 22:12:16 +0000 (22:12 +0000)]
Merge "Fix duplicate automatic file backend bug"

8 years agoFix duplicate automatic file backend bug
Aaron Schulz [Tue, 6 Oct 2015 21:43:12 +0000 (14:43 -0700)]
Fix duplicate automatic file backend bug

Follow-up 8a3816529a

Bug: T114810
Change-Id: I2706c90077627b3df35fe530e0a919cfd0a75d78

8 years agoMerge "Change getCacheSetOptions() callers to use "Database""
jenkins-bot [Tue, 6 Oct 2015 21:29:25 +0000 (21:29 +0000)]
Merge "Change getCacheSetOptions() callers to use "Database""

8 years agoMerge "Add UserMailerTransformX and UserMailerSplitTo hooks"
jenkins-bot [Tue, 6 Oct 2015 21:09:51 +0000 (21:09 +0000)]
Merge "Add UserMailerTransformX and UserMailerSplitTo hooks"

8 years agoMerge "Defer execution of HTMLCacheUpdate instances"
jenkins-bot [Tue, 6 Oct 2015 21:00:37 +0000 (21:00 +0000)]
Merge "Defer execution of HTMLCacheUpdate instances"

8 years agoFix AssembleUploadChunksJob/PublishStashedFileJob IDEA errors
Aaron Schulz [Tue, 6 Oct 2015 20:50:04 +0000 (13:50 -0700)]
Fix AssembleUploadChunksJob/PublishStashedFileJob IDEA errors

* Use getMessage() on the Exception objects
* Use a dummy WebRequestUpload to pass to continueChunks()
  instead of an object of a completely wrong type

Change-Id: I01ec5c141a6f37ee425af3236d728b9128b98522

8 years agoMerge "Remove ORM use from DBSiteStore"
jenkins-bot [Tue, 6 Oct 2015 20:35:26 +0000 (20:35 +0000)]
Merge "Remove ORM use from DBSiteStore"

8 years agoDefer execution of HTMLCacheUpdate instances
Aaron Schulz [Tue, 6 Oct 2015 20:31:31 +0000 (13:31 -0700)]
Defer execution of HTMLCacheUpdate instances

None of these places need it to happen right now,
so for performance and consistent style, defer
them too.

Change-Id: Id0a2a352bfc04a783c3ebc54b059b241bb6a6f7e

8 years agoAdd UserMailerTransformX and UserMailerSplitTo hooks
Gergő Tisza [Thu, 1 Oct 2015 03:05:23 +0000 (03:05 +0000)]
Add UserMailerTransformX and UserMailerSplitTo hooks

UserMailerTransformContent allows extensions to change the body of
an email sent via UserMailer::send(). This is applied before
low-level transformations such as multipart or content encoding.

UserMailerTransformMessage is similar but it is run after those
transformations.

UserMailerSplitTo allows extensions to request that a certain
user should always be emailed separately (so when UserMailer::send()
is called with an array of target addresses, that user will be split
out into a separate call). This is intended for content
transformations which need to be different per user, such as
encryption.

A side effect is that while before a call to UserMailer::send() was
either fully succeeded or fully failed, now the message might be
delivered to some targets but not others. send() will return a failed
Status object in those cases.

Bug: T12453
Change-Id: I4c3a018110173c3b5d52a753fdcbec397b590ced

8 years agoRemove ORM use from DBSiteStore
Brad Jorsch [Tue, 6 Oct 2015 17:08:56 +0000 (13:08 -0400)]
Remove ORM use from DBSiteStore

This loses something of the genericity of the former DBSiteStore (i.e.
it's now tied to MediaWiki's database and sites table, and subclasses
and users can't easily override that), but nothing in core or extensions
in Gerrit was using that genericity so it's probably no big loss.

Further, T113034 (an RFC to actually use this 'site' stuff for its
original purpose) proposes getting rid of SiteStore anyway.

Bug: T114538
Change-Id: I7e7ca257451e6307a7e5bb11fd393283d0d19e77

8 years agoMerge "MultiHttpClient: Don't use "MW" in User-Agent"
jenkins-bot [Tue, 6 Oct 2015 20:15:32 +0000 (20:15 +0000)]
Merge "MultiHttpClient: Don't use "MW" in User-Agent"

8 years agoMultiHttpClient: Don't use "MW" in User-Agent
Timo Tijhof [Tue, 6 Oct 2015 19:45:03 +0000 (12:45 -0700)]
MultiHttpClient: Don't use "MW" in User-Agent

Follows-up 6f51037d680ce.

Change-Id: I5e404c3a6ab9c3d1126676ee5fc22149422aa51f

8 years agoMerge "Remove double load of mediawiki.action.view.filepage"
jenkins-bot [Tue, 6 Oct 2015 19:51:05 +0000 (19:51 +0000)]
Merge "Remove double load of mediawiki.action.view.filepage"

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 6 Oct 2015 19:45:39 +0000 (21:45 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I2ea395b34db5dde21a7c7024fe8dd3b410350a44

8 years agoRemove double load of mediawiki.action.view.filepage
umherirrender [Fri, 4 Sep 2015 15:30:17 +0000 (17:30 +0200)]
Remove double load of mediawiki.action.view.filepage

To be merged 30 days after I8a0f0fecc53967bf2b0241ce92bbbd10b8fc704a is
deployed (should be 1.26wmf22)

Change-Id: I61d53080beceff2d8aac06c617035135557e4c47

8 years agoMerge "Revert "Remove mismatched COMMIT from FileDeleteForm""
jenkins-bot [Tue, 6 Oct 2015 19:20:45 +0000 (19:20 +0000)]
Merge "Revert "Remove mismatched COMMIT from FileDeleteForm""

8 years agoRevert "Remove mismatched COMMIT from FileDeleteForm"
Aaron Schulz [Tue, 6 Oct 2015 19:06:26 +0000 (19:06 +0000)]
Revert "Remove mismatched COMMIT from FileDeleteForm"

The doDeleteArticleReal() call does BEGIN but not COMMIT
and the LocalFile::delete() does no trx commands because
trxLevel() > 0, so the COMMIT here is needed as things are.

This reverts commit 985a8f721459ebea1dc5a0daa178295eec8cf444.

Change-Id: I72529965ae9fe41641f22af12a40ec13ff65a2c1

8 years agoRemove begin/commit from recordUpload2()
Aaron Schulz [Tue, 6 Oct 2015 19:02:11 +0000 (12:02 -0700)]
Remove begin/commit from recordUpload2()

Use deferred updates and transaction hooks
to get the cache updates after the publish()
DB updates instead

Change-Id: I0a922182f7dd5f22c1e661171b0df1a49a637aef

8 years agoMerge "Add more test cases to OldChangesListTest"
jenkins-bot [Tue, 6 Oct 2015 18:29:31 +0000 (18:29 +0000)]
Merge "Add more test cases to OldChangesListTest"

8 years agoEnable PSR2.Methods.MethodDeclaration.Underscore
umherirrender [Sat, 3 Oct 2015 18:52:31 +0000 (20:52 +0200)]
Enable PSR2.Methods.MethodDeclaration.Underscore

Whitelist StubObject because the underscore is for internal use.

Change-Id: I4beeee8df8cde079b810a372539e3c169e80f2d3

8 years agoAPI: Add ApiQueryAllRevisions
Brad Jorsch [Sun, 27 Sep 2015 19:43:05 +0000 (15:43 -0400)]
API: Add ApiQueryAllRevisions

Bug: T113885
Change-Id: I43bdc1e33945dab27466fc047d78af5e65df1740

8 years agoMerge "Sort MWNamespace::getValidNamespaces list numerically"
jenkins-bot [Tue, 6 Oct 2015 16:20:57 +0000 (16:20 +0000)]
Merge "Sort MWNamespace::getValidNamespaces list numerically"

8 years agoAdd more test cases to OldChangesListTest
aude [Mon, 1 Sep 2014 10:23:15 +0000 (12:23 +0200)]
Add more test cases to OldChangesListTest

* test for watchlist css class
* test for number of watching users

Change-Id: I6aea1f5b8479ac3656f0ba27ebfa3800d9bffb4c

8 years agoReenable LineLength phpcs check
Amir E. Aharoni [Sun, 27 Sep 2015 07:27:49 +0000 (10:27 +0300)]
Reenable LineLength phpcs check

Bug: T102614
Change-Id: If853510b55d787765a84bac22b2dbff2e6c526c0

8 years agoFix long line to make phpcs pass
Amir E. Aharoni [Tue, 6 Oct 2015 13:04:32 +0000 (16:04 +0300)]
Fix long line to make phpcs pass

Bug: T102614
Change-Id: I2b14938366a8cc0e911f98ebb0d3e31f0fd31899

8 years agoAdded @since to Database
Aaron Schulz [Tue, 6 Oct 2015 05:41:05 +0000 (22:41 -0700)]
Added @since to Database

Change-Id: Ia4396317bb3c78ab6b60ecbf0e1825e44ed08589

8 years agoChange getCacheSetOptions() callers to use "Database"
Aaron Schulz [Tue, 6 Oct 2015 05:06:46 +0000 (22:06 -0700)]
Change getCacheSetOptions() callers to use "Database"

* This is less verbose that DatabaseBase
* Also add a few WAN cache doc comments

Change-Id: I5b6de6d0ffa06753ea96c50b63db7dae796475dc

8 years agoAdd User-Agent support to MultiHttpClient requests
Tim Starling [Tue, 6 Oct 2015 01:07:29 +0000 (12:07 +1100)]
Add User-Agent support to MultiHttpClient requests

Because it is polite to send a User-Agent (and as part of T114558
investigation).

Change-Id: I5096896d0891c0c9674ff8b4284aaa3ac7293c67

8 years agoSort MWNamespace::getValidNamespaces list numerically
Bryan Davis [Tue, 6 Oct 2015 04:12:32 +0000 (22:12 -0600)]
Sort MWNamespace::getValidNamespaces list numerically

Bug: T109137
Change-Id: Ic6b7635884628c8c3cf1cdfb01dad49bab292d6c

8 years agoMerge "objectcache: Add BagOStuff::getWithSetCallback() convenience method"
jenkins-bot [Tue, 6 Oct 2015 00:36:13 +0000 (00:36 +0000)]
Merge "objectcache: Add BagOStuff::getWithSetCallback() convenience method"

8 years agoobjectcache: Add BagOStuff::getWithSetCallback() convenience method
Aaron Schulz [Sat, 3 Oct 2015 19:37:28 +0000 (12:37 -0700)]
objectcache: Add BagOStuff::getWithSetCallback() convenience method

Change-Id: I9cc162ff1cc48c1c500f2999327bd18ba235bfd0

8 years agoBreak numerous long lines in InfoAction
Aaron Schulz [Sun, 4 Oct 2015 19:22:19 +0000 (12:22 -0700)]
Break numerous long lines in InfoAction

Change-Id: Ia873dce8aeab3c7ce93610a70fe78034addd39d7

8 years agoMerge "Make WANObjectCache sets account for slave lag"
jenkins-bot [Tue, 6 Oct 2015 00:11:22 +0000 (00:11 +0000)]
Merge "Make WANObjectCache sets account for slave lag"

8 years agoMerge "Remove return value from FormSpecialPage::checkExecutePermissions"
jenkins-bot [Tue, 6 Oct 2015 00:00:23 +0000 (00:00 +0000)]
Merge "Remove return value from FormSpecialPage::checkExecutePermissions"

8 years agoMerge "Remove setting of $wgReadOnly in LBFactoryMulti"
jenkins-bot [Tue, 6 Oct 2015 00:00:20 +0000 (00:00 +0000)]
Merge "Remove setting of $wgReadOnly in LBFactoryMulti"

8 years agoMerge "Clean up Special:Undelete read-only checks"
jenkins-bot [Mon, 5 Oct 2015 23:50:57 +0000 (23:50 +0000)]
Merge "Clean up Special:Undelete read-only checks"

8 years agoMerge "Cleanups to MigrateFileRepoLayout"
jenkins-bot [Mon, 5 Oct 2015 23:50:38 +0000 (23:50 +0000)]
Merge "Cleanups to MigrateFileRepoLayout"

8 years agoMerge "Start rename of DatabaseBase => Database"
jenkins-bot [Mon, 5 Oct 2015 23:45:36 +0000 (23:45 +0000)]
Merge "Start rename of DatabaseBase => Database"

8 years agoMake WANObjectCache sets account for slave lag
Aaron Schulz [Thu, 1 Oct 2015 02:40:09 +0000 (19:40 -0700)]
Make WANObjectCache sets account for slave lag

* This gets lag information that is useful when
  the calling code is about to run queries that
  will have their results cached.
* This is now used in place of trxTimestamp() for
  WANObjectCache set() and getWithSetCallback().
* The WAN cache will use a low TTL if the lag is
  too high to avoid caching stale data for weeks.
* Bumped MAX_COMMIT_DELAY as nothing enforces it.

Bug: T113204
Change-Id: I2a95b4088cff42d6e980351555f81a4b13519e24

8 years agoMerge "Remove mismatched COMMIT from FileDeleteForm"
jenkins-bot [Mon, 5 Oct 2015 23:24:54 +0000 (23:24 +0000)]
Merge "Remove mismatched COMMIT from FileDeleteForm"

8 years agoMerge "Remove ?maxlag check in index.php"
jenkins-bot [Mon, 5 Oct 2015 23:21:37 +0000 (23:21 +0000)]
Merge "Remove ?maxlag check in index.php"

8 years agoMerge "objectcache: Add BagOStuff::READ_VERIFIED flag to get()"
jenkins-bot [Mon, 5 Oct 2015 23:13:24 +0000 (23:13 +0000)]
Merge "objectcache: Add BagOStuff::READ_VERIFIED flag to get()"

8 years agoobjectcache: Add BagOStuff::READ_VERIFIED flag to get()
Aaron Schulz [Sat, 3 Oct 2015 07:43:40 +0000 (00:43 -0700)]
objectcache: Add BagOStuff::READ_VERIFIED flag to get()

* This lets multiwrite backends upgrade cached items
  to higher tiers using UPGRADE_TTL.
* This is useful for memcached/sql tiers or apc/memcached.

Change-Id: I34b30ce8b54f8de36429d48c80f6768aed310272

8 years agoTitle: Fix @param for TS_MW to be string instead of int
Timo Tijhof [Mon, 5 Oct 2015 21:39:07 +0000 (14:39 -0700)]
Title: Fix @param for TS_MW to be string instead of int

Follows-up 6b0163391.

Change-Id: I7c45e1968b6ba8db0e5b19b8ca819e6ecc5764c9

8 years agoMerge "mediawiki.jqueryMsg: Always parse messages with '&'"
jenkins-bot [Mon, 5 Oct 2015 21:36:47 +0000 (21:36 +0000)]
Merge "mediawiki.jqueryMsg: Always parse messages with '&'"

8 years agoMerge "Fix DatabaseSqlite::__toString"
jenkins-bot [Mon, 5 Oct 2015 21:03:39 +0000 (21:03 +0000)]
Merge "Fix DatabaseSqlite::__toString"

8 years agoFix DatabaseSqlite::__toString
Marius Hoch [Mon, 5 Oct 2015 20:42:28 +0000 (22:42 +0200)]
Fix DatabaseSqlite::__toString

Failed with "Catchable fatal error: Object of class
PDO could not be converted to string in".

The message I used was a rather arbitrary choice, but
I think it makes sense.

Bug: T114709
Change-Id: I0023fae3fa2a0c2b37cb3c34751706fe0d481d19

8 years agoMerge "mediawiki.jqueryMsg: Refactor handling of replacements/parameters in links"
jenkins-bot [Mon, 5 Oct 2015 20:51:30 +0000 (20:51 +0000)]
Merge "mediawiki.jqueryMsg: Refactor handling of replacements/parameters in links"

8 years agoMerge "Fix DatabaseMysqlBase.php IDEA errors"
jenkins-bot [Mon, 5 Oct 2015 20:20:17 +0000 (20:20 +0000)]
Merge "Fix DatabaseMysqlBase.php IDEA errors"

8 years agoMerge "Localisation updates from https://translatewiki.net."
Translation updater bot [Mon, 5 Oct 2015 20:03:08 +0000 (20:03 +0000)]
Merge "Localisation updates from https://translatewiki.net."

8 years agoMerge "Update various @params from DatabaseBase to IDatabase"
jenkins-bot [Mon, 5 Oct 2015 19:59:21 +0000 (19:59 +0000)]
Merge "Update various @params from DatabaseBase to IDatabase"

8 years agoMerge "Database debug log cleanup (remove wgDebugDumpSqlLength/wgDebugDBTransactions)"
jenkins-bot [Mon, 5 Oct 2015 19:57:45 +0000 (19:57 +0000)]
Merge "Database debug log cleanup (remove wgDebugDumpSqlLength/wgDebugDBTransactions)"

8 years agoMerge "Make generalizeSQL() protected"
jenkins-bot [Mon, 5 Oct 2015 19:53:03 +0000 (19:53 +0000)]
Merge "Make generalizeSQL() protected"

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 5 Oct 2015 19:50:30 +0000 (21:50 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ic61a81aba3e8c28526a5428ff73ac41f6e1a7d34

8 years agoDatabase debug log cleanup (remove wgDebugDumpSqlLength/wgDebugDBTransactions)
Aaron Schulz [Sun, 4 Oct 2015 18:39:58 +0000 (11:39 -0700)]
Database debug log cleanup (remove wgDebugDumpSqlLength/wgDebugDBTransactions)

* Simplify the debug log call and use queries group
* Remove $wgDebugDumpSqlLength, as profiler output
  already has shortened query strings (one can use
  profiling without DBO_DEBUG)
* Removed $wgDebugDBTransactions as BEGIN/COMMIT already show
* Removed PostgresTransactionState as it was only used for
  $wgDebugDBTransactions handling
* This cuts down on lots of global variable usage

Change-Id: I185adb1694441d074dea965960429b4910727620

8 years agoRemove mismatched COMMIT from FileDeleteForm
Aaron Schulz [Sat, 3 Oct 2015 01:04:45 +0000 (18:04 -0700)]
Remove mismatched COMMIT from FileDeleteForm

* Rely on the main DBO_TRX to commit at request end

Change-Id: Iad545db3603335baddc4156128f1dd756dbe99b4

8 years agoresourceloader: Tiny optimization to ResourceLoader::isValidModuleName()
Ori Livneh [Mon, 5 Oct 2015 18:39:13 +0000 (11:39 -0700)]
resourceloader: Tiny optimization to ResourceLoader::isValidModuleName()

This is a micro-optimization, but ResourceLoader is so well-optimized at this
point that the call to PCRE accounts for 1.25% of all load.php CPU time. So
might as well making it a tiny bit faster.

Change-Id: Iefab804a6ca6d54ce230958513a3bea44f4e7c62

8 years agoMerge "mw.widgets: Split CategorySelector widget to its own module"
jenkins-bot [Mon, 5 Oct 2015 19:17:27 +0000 (19:17 +0000)]
Merge "mw.widgets: Split CategorySelector widget to its own module"

8 years agomw.widgets: Split CategorySelector widget to its own module
Florian [Mon, 5 Oct 2015 17:41:40 +0000 (19:41 +0200)]
mw.widgets: Split CategorySelector widget to its own module

It's currently used by ForeignStructuredUpload only, so it's easy to split
it now and make mw.widgets as small as possible (you need to load only the
module of the widget(s) you want to use).

Bug: T108733
Change-Id: I147892eccdd5f7e0f53f824ea4d47e02984047f5

8 years agoSmall optimization for FileContentsHasher
Ori Livneh [Mon, 5 Oct 2015 17:56:32 +0000 (10:56 -0700)]
Small optimization for FileContentsHasher

Make sure that PHP warnings are suppressed and restored once per invocation of
FileContentsHasher::getFileContentsHash(), rather than once or twice per file.

Change-Id: I814093f226d62e5e479411d0c3a7bbbe4998255a

8 years agoMerge "Add null to @return tags if a method can return null"
jenkins-bot [Mon, 5 Oct 2015 17:56:00 +0000 (17:56 +0000)]
Merge "Add null to @return tags if a method can return null"

8 years agoAdd null to @return tags if a method can return null
Thiemo Mättig [Mon, 5 Oct 2015 15:53:13 +0000 (17:53 +0200)]
Add null to @return tags if a method can return null

Change-Id: I420998351663d92c4a101f61842e40591eebcd5f

8 years agomediawiki.jqueryMsg: Always parse messages with '&'
Bartosz Dziewoński [Mon, 5 Oct 2015 12:50:29 +0000 (14:50 +0200)]
mediawiki.jqueryMsg: Always parse messages with '&'

To give consistent output for messages containing HTML entities.

Turns out that we're also inconsistent about escaping in HTML tag
attributes vs. escaping in text (see tests for 'jquerymsg-entities2'
and 'jquerymsg-entities-attr2'). This patch does not try to fix this.

Bug: T55576
Change-Id: I08cf9d552d1f0243a160babb8c3cf9f257be1be3

8 years agomediawiki.jqueryMsg: Refactor handling of replacements/parameters in links
Bartosz Dziewoński [Mon, 5 Oct 2015 09:45:08 +0000 (11:45 +0200)]
mediawiki.jqueryMsg: Refactor handling of replacements/parameters in links

You should now be able to use replacements/parameters (such as '$1')
anywhere inside both link text and link target, in both external links
('[http://foo/ Bar]') and wikilinks ('[[Foo|Bar]]').

As a side effect of various cleanups, HTML in link text is now preserved
in all cases and is never wrapped in <span class="mediaWiki_htmlEmitter">.

Added test cases for it all.

Bug: T49395
Bug: T50064
Change-Id: I56d8f7ec03a70f5c2360d9c5099496ecb2f668ad

8 years agoMerge "Fix the last Generic.Files.LineLength phpcs failures"
jenkins-bot [Mon, 5 Oct 2015 12:39:24 +0000 (12:39 +0000)]
Merge "Fix the last Generic.Files.LineLength phpcs failures"

8 years agoEnforce lagged-slave read-only mode on the DB layer
Aaron Schulz [Mon, 5 Oct 2015 05:15:33 +0000 (22:15 -0700)]
Enforce lagged-slave read-only mode on the DB layer

* Most callers gracefully check wfReadOnly(),
  but fail in case they dont. This also catches
  foreign DBs which might slip through the cracks.
* Also remove useless wfDebug() call around
  mDoneWrites check as write queries show in
  the logs anyway.

Change-Id: I560ebd19c4eb2b3a040d4331702346440617cfaa

8 years agoUpdate various @params from DatabaseBase to IDatabase
Aaron Schulz [Sun, 4 Oct 2015 09:07:25 +0000 (02:07 -0700)]
Update various @params from DatabaseBase to IDatabase

Change-Id: I98e44cdffb0fc0d729f69f702799139afb988c20

8 years agoRemove setting of $wgReadOnly in LBFactoryMulti
Aaron Schulz [Mon, 5 Oct 2015 05:16:38 +0000 (22:16 -0700)]
Remove setting of $wgReadOnly in LBFactoryMulti

wfReadOnly() already pulls in this information

Change-Id: I7c4693f0e69decefcc0cf52168fa2b71152eb99b

8 years agoCleanups to MigrateFileRepoLayout
Aaron Schulz [Mon, 5 Oct 2015 04:45:25 +0000 (21:45 -0700)]
Cleanups to MigrateFileRepoLayout

* Use "bypassReadOnly" as other file backend maintenance
  scripts do.  One may want to run this while site traffic
  is off via $wgReadOnly.
* Fixed handling for when img_sha1 is not set.
* Fixed some IDEA errors.

Change-Id: I95c426c5f2082576fc9ea40282d2869750a9f3d8

8 years agoPass the search term into the SpecialSearchResultsAppend hook
Marius Hoch [Sun, 4 Oct 2015 20:44:12 +0000 (22:44 +0200)]
Pass the search term into the SpecialSearchResultsAppend hook

Very useful to do things that need to know the actual search
term (eg. to show further things related to that).

The old hook supported that as well, as documented on
https://www.mediawiki.org/wiki/Manual:Hooks/SpecialSearchResultsAppend

That hook has been re-introduced with e7551f16

Change-Id: I7ac6ad95b29f9da0802eb3340e27b8683bf9f76d

8 years agoClean up Special:Undelete read-only checks
Aaron Schulz [Sun, 4 Oct 2015 20:35:16 +0000 (13:35 -0700)]
Clean up Special:Undelete read-only checks

* Use the standard SpecialPage method
* Show the error when trying to view the form for a page

Change-Id: I60a939e7d1a1164db2dc90525a750573be75fbcc

8 years agoRemove return value from FormSpecialPage::checkExecutePermissions
Aaron Schulz [Sun, 4 Oct 2015 20:22:01 +0000 (13:22 -0700)]
Remove return value from FormSpecialPage::checkExecutePermissions

It is unused and few callers comply with it

Change-Id: I3ac02ca996b57bf2222006712cc988a064dc38e5

8 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 4 Oct 2015 20:02:58 +0000 (22:02 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I2c6d6bb15910feb1b8da5565bc27bfe7878bc0e4

8 years agoStart rename of DatabaseBase => Database
Aaron Schulz [Sun, 4 Oct 2015 19:17:57 +0000 (12:17 -0700)]
Start rename of DatabaseBase => Database

This gives static method callers the option
to use methods like Database::factory() instead
of having to use the uglier DatabaseBase::factory().

Change-Id: I61800626b71ad2803a897df060059dbaf8778679