lhc/web/wiklou.git
5 years agoDo not create new archive file names for old files
Thiemo Kreuz [Wed, 2 Jan 2019 14:34:59 +0000 (15:34 +0100)]
Do not create new archive file names for old files

When importing a previously archived file revision, \OldLocalFile::uploadOld()
calls \LocalFile::publishTo() with $dstRel pointing to a location in the
archive. It does not make sense to create a new archive file name for a file
that is already in the archive. Instead, use the existing archive file name.

* Note how $archiveName is not used in the code below, except as part of the
  returned status.
* $archiveRel ends in \FileRepo::publishBatch(), but is barely used there
  except for (again) the status.
* \FileRepo::publishBatch() makes use of the dirname() extracted from
  $archiveRel. This patch does not make changes to this path, only to the
  file name.

This is the most trivial patch we could think of to fix the bug that the
return value is not the documented one ("On success, the value member
contains the archive name").

This will be covered by the test introduced in I15fad26.

Bug: T200001
Bug: T210755
Change-Id: I28b782e9b41ed78ac1674111094335849e15ba49

5 years agoMerge "Add a user preference to opt in or out of a confirmation prompt for rollbacks."
jenkins-bot [Thu, 21 Mar 2019 10:10:34 +0000 (10:10 +0000)]
Merge "Add a user preference to opt in or out of a confirmation prompt for rollbacks."

5 years agoMerge "resources: Add verifiable upstream for various jquery plugins"
jenkins-bot [Thu, 21 Mar 2019 08:47:34 +0000 (08:47 +0000)]
Merge "resources: Add verifiable upstream for various jquery plugins"

5 years agoAdd a user preference to opt in or out of a confirmation prompt for rollbacks.
tzhelyazkova [Thu, 21 Mar 2019 08:05:27 +0000 (09:05 +0100)]
Add a user preference to opt in or out of a confirmation prompt for rollbacks.

Bug: T199537
Change-Id: I2f08ef5f8c38f23b282e130d040681fc060b6b00

5 years agordbms: support setting PRAGMA for synchronous in DatabaseSqlite
Aaron Schulz [Thu, 14 Mar 2019 07:55:50 +0000 (00:55 -0700)]
rdbms: support setting PRAGMA for synchronous in DatabaseSqlite

Change-Id: I74e2114627ecf3f32827dfe2923a8c0294879e92

5 years agoWatchedItemStore: Use batching in setNotificationTimestampsForUser
Roan Kattouw [Wed, 16 Jan 2019 21:51:54 +0000 (13:51 -0800)]
WatchedItemStore: Use batching in setNotificationTimestampsForUser

Update rows in batches, using the same logic as is used by
removeWatchBatchForUser().

Also remove the functionality for updating all rows, and move that to
resetAllNotificationTimestampsForUser() instead. To that end, add a
timestamp parameter to that method and to the job it uses, and make
setNotificationTimestampsForUser() behave like a backwards-compatibility
wrapper around resetAllNotificationTimestampsForUser() when no list of
titles is specified.

Bug: T207941
Change-Id: I58342257395de6fcfb4c392b3945b12883ca1680
Follows-Up: I2008ff89c95fe6f66a3fd789d2cef0e8fe52bd93

5 years agoMerge "build: Remove git-depth:3 from Travis CI config"
jenkins-bot [Thu, 21 Mar 2019 02:31:56 +0000 (02:31 +0000)]
Merge "build: Remove git-depth:3 from Travis CI config"

5 years agobuild: Remove git-depth:3 from Travis CI config
Timo Tijhof [Thu, 21 Mar 2019 00:30:46 +0000 (00:30 +0000)]
build: Remove git-depth:3 from Travis CI config

Follows-up 236b7ae849.

The git-clone protocol does not support checking out a specific
commit directly. It requires that you clone first from a specific
branch (with an optional specified limited depth) and then you
can checkout a commit.

Limiting the depth means that the Travis CI build fails if when
the build starts at a time where there are at least N commits
in master after the one being tested.

This can happen if more than 3 commits merge within 15 minutes
of time (which is how long our Travis build takes roughly).
While that might seem unlikely given our Jenkins build take
about the same amount of time, our Zuul is able to anticipate
ahead of a merge and actually test many commits at once and then
once they all pass, merge them all at once.

Aside from that, one can also click "Restart" as repo admin in
Travis, which always fails for a past build basically.

Change-Id: I2a46821d6d78e637f03de0c4aa25a3488253ff1a

5 years agoresources: Add verifiable upstream for various jquery plugins
Timo Tijhof [Wed, 20 Mar 2019 23:57:38 +0000 (23:57 +0000)]
resources: Add verifiable upstream for various jquery plugins

* jStorage: Plain v0.4.12 release.

* throttle-debounce: Plain v1.1 release.

* jquery.form:
  Plain release. (But they don't have a git tag for it).

* jquery.fullscreen:
  This was a pre-release committed in 3fe5f92a26f02 to fix
  a bug in IE11. We modified the header to indiciate which
  unreleased hash it came from upstream. Shortly after that,
  upstream released it proper (only the header was different).

* hoverIntent:
  I accidentally modified this file in 2011 with 85d5e617d77a1f.
  That (insignificant) change is now reverted.

Change-Id: Ibb1d368473b2a4b13795afedb66271a44e7e5bae

5 years agoMerge "Add support for Element Timing API"
jenkins-bot [Wed, 20 Mar 2019 23:35:07 +0000 (23:35 +0000)]
Merge "Add support for Element Timing API"

5 years agoMerge "OOUI: Bring forward UBN fix for DropdownInputWidget with MenuSectionOptionWidget"
jenkins-bot [Wed, 20 Mar 2019 23:30:55 +0000 (23:30 +0000)]
Merge "OOUI: Bring forward UBN fix for DropdownInputWidget with MenuSectionOptionWidget"

5 years agoMerge "Validate the output of the dump scripts."
jenkins-bot [Wed, 20 Mar 2019 23:13:50 +0000 (23:13 +0000)]
Merge "Validate the output of the dump scripts."

5 years agoOOUI: Bring forward UBN fix for DropdownInputWidget with MenuSectionOptionWidget
James D. Forrester [Wed, 20 Mar 2019 23:10:11 +0000 (16:10 -0700)]
OOUI: Bring forward UBN fix for DropdownInputWidget with MenuSectionOptionWidget

Bug: T218722
Bug: T218830
Change-Id: Id220e5f71aa335e0c3abf572a9172c7c83376271

5 years agoMerge "Check whether a user is blocked from upload in ApiUpload"
jenkins-bot [Wed, 20 Mar 2019 22:47:53 +0000 (22:47 +0000)]
Merge "Check whether a user is blocked from upload in ApiUpload"

5 years agoMerge "CSP: Minor cleanup in ContentSecurityPolicy.php"
jenkins-bot [Wed, 20 Mar 2019 22:31:48 +0000 (22:31 +0000)]
Merge "CSP: Minor cleanup in ContentSecurityPolicy.php"

5 years agoCheck whether a user is blocked from upload in ApiUpload
Thalia [Wed, 20 Mar 2019 22:11:33 +0000 (22:11 +0000)]
Check whether a user is blocked from upload in ApiUpload

Partially blocked users are not blocked from uploading, so check
explicitly whether a user is blocked from uploading, rather than
simply whether they have a block.

Bug: T217255
Change-Id: I21089a90202941ec3bc5bdbf9c0d2e7cab00b365

5 years agoCSP: Minor cleanup in ContentSecurityPolicy.php
Derick Alangi [Wed, 20 Mar 2019 21:51:56 +0000 (22:51 +0100)]
CSP: Minor cleanup in ContentSecurityPolicy.php

Cleanups include;
- Remove elseif() path for cases where if has a return state
  and instead convert the elseif() into an if.
- Fix PHPDoc for non-existent parameter. Corrected parameter
  name.
- Add @throws phpdoc annotation for a method that could throw
  an exception.
- Remove unnecessary parentheses.
- Make sure line doesn't exceed 100 characters.

Change-Id: Ic2d882ae0c6f3859b5a268b1bfb50c8eafa294d9

5 years agoMerge "Avoid counting input lines twice in BlockLevelPass::execute()"
jenkins-bot [Wed, 20 Mar 2019 21:53:24 +0000 (21:53 +0000)]
Merge "Avoid counting input lines twice in BlockLevelPass::execute()"

5 years agoMerge "BlockLevelPass: further fixes for T218817"
jenkins-bot [Wed, 20 Mar 2019 21:45:20 +0000 (21:45 +0000)]
Merge "BlockLevelPass: further fixes for T218817"

5 years agoAvoid counting input lines twice in BlockLevelPass::execute()
C. Scott Ananian [Wed, 20 Mar 2019 20:37:49 +0000 (16:37 -0400)]
Avoid counting input lines twice in BlockLevelPass::execute()

In T208070 / I120ca25a77b7b933de4afddd1d458e36a95e26da we added a
check whether we were processing the last line of input, in order
to avoid emitting extra trailing newlines.  But if the number of
input lines is large, StringUtils::explode() will return an
iterator which doesn't implement Countable for efficiency.
I22eebb70af1b19d7c25241fc78bfcced4470e78a fixed this, but at the
cost of scanning the string twice: once just to count the number
of newlines before we begin to iterate over the lines.

This patch uses Iterator::valid() to determine if we're on the
last iteration without having to scan the string twice.

Bug: T208070
Bug: T218817
Change-Id: I41a45266d266195aa6002d3854e018cacf052ca6

5 years agoBlockLevelPass: further fixes for T218817
Arlo Breault [Wed, 20 Mar 2019 21:02:39 +0000 (17:02 -0400)]
BlockLevelPass: further fixes for T218817

The previous fix for T218817 (I22eebb70af1b19d7c25241fc78bfcced4470e78a)
was a bit premature: we didn't notice that ExplodeIterator *also*
used a different Iterator::key() than ArrayIterator -- it used
the string position as a key, not the line number.  Combined with
an inequality test for "not the last line" meant that almost every
line was now the "last line" and we were missing a lot of needed
newlines.

Count the lines ourselves to fix the problem.

Bug: T208070
Bug: T218817
Change-Id: I55a2c4c0ec304292162c51aa88b206fea0142392

5 years agoValidate the output of the dump scripts.
daniel [Fri, 14 Dec 2018 11:06:45 +0000 (12:06 +0100)]
Validate the output of the dump scripts.

This introduces XML schema validation into the unit tests for
the backup dump scripts. This is intended to ensure that the
output keeps conforming to the schema when updating XmlDumpWriter
and friends to support newer schema versions.

Bug: T174031
Change-Id: Iafa8cb8ba5b3684a08172e92974edaf0482f19b7

5 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Wed, 20 Mar 2019 20:58:59 +0000 (20:58 +0000)]
Merge "Localisation updates from https://translatewiki.net."

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 20 Mar 2019 20:56:08 +0000 (21:56 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I213ca5e0b1b5fc1bfb666d1246086b3ed5f2866b

5 years agoparser: Count occurrences of newlines
Arlo Breault [Wed, 20 Mar 2019 20:32:10 +0000 (16:32 -0400)]
parser: Count occurrences of newlines

StringUtils::explode() returns an ExplodeIterator if the number of
separators is too high, which doesn't implement count.

So count the way that explode does.

Bug: T218817
Change-Id: I22eebb70af1b19d7c25241fc78bfcced4470e78a

5 years agoMerge "context: Cleanup is_null() checks and irrelevant else code paths"
jenkins-bot [Wed, 20 Mar 2019 20:16:29 +0000 (20:16 +0000)]
Merge "context: Cleanup is_null() checks and irrelevant else code paths"

5 years agocontext: Cleanup is_null() checks and irrelevant else code paths
Derick Alangi [Wed, 20 Mar 2019 18:53:00 +0000 (19:53 +0100)]
context: Cleanup is_null() checks and irrelevant else code paths

This class specifically has these 2 things in many cases and converts
into the use of a tenary operations.

Quoting @Thiemo_WMDE from Gerrit comment: "The ?: operator will skip
empty arrays, empty strings, as well as the string "0". But this is
not a problem here because the properties under test are all objects.
Objects are always considered true in PHP."

Sample change can be seen below as, from;
```
if ( !is_null( $this->skin )) {
    return $this->skin;
} else {
    return $this->getContext()->getSkin();
}

```

to

```
return $this->skin ?: $this->getContext()->getSkin();
```

Change-Id: I377b118d86a24c7bcb15512f6714e6201a3e36ee

5 years agoMerge "db: Remove property assignment overriden by constructor"
jenkins-bot [Wed, 20 Mar 2019 19:35:07 +0000 (19:35 +0000)]
Merge "db: Remove property assignment overriden by constructor"

5 years agoMerge "objectcache: make BagOStuff::changeTTL() more atomic"
jenkins-bot [Wed, 20 Mar 2019 19:04:24 +0000 (19:04 +0000)]
Merge "objectcache: make BagOStuff::changeTTL() more atomic"

5 years agodb: Use brackets `()` in operation for better readability
Derick Alangi [Wed, 20 Mar 2019 16:24:35 +0000 (17:24 +0100)]
db: Use brackets `()` in operation for better readability

Wrap the expression into () to improve readability of the code.

Change-Id: Id53ea4709a7601fd1354833a44bd652570c733e6

5 years agodb: Remove property assignment overriden by constructor
Derick Alangi [Wed, 20 Mar 2019 17:36:03 +0000 (18:36 +0100)]
db: Remove property assignment overriden by constructor

As these class properties are overriden by the class constructor,
we can safely remove them. In addition, remove a useless "/" in a
PHPDoc.

Change-Id: I9cecfc8a0e5b58c931ee32c7465c064a9add1a77

5 years agoobjectcache: make BagOStuff::changeTTL() more atomic
Aaron Schulz [Wed, 20 Mar 2019 16:46:33 +0000 (09:46 -0700)]
objectcache: make BagOStuff::changeTTL() more atomic

Change-Id: I86493498ef3359046b12d51795cf7875af6c3a6c

5 years agoMerge "storage: Fix typo in NameTableStore::purgeWANCache comments"
jenkins-bot [Wed, 20 Mar 2019 09:24:22 +0000 (09:24 +0000)]
Merge "storage: Fix typo in NameTableStore::purgeWANCache comments"

5 years agoAdd support for Element Timing API
Gilles Dubuc [Tue, 19 Mar 2019 10:22:13 +0000 (11:22 +0100)]
Add support for Element Timing API

https://github.com/WICG/element-timing

Bug: T216598
Change-Id: Ieda41f5074784957760c17dc15f7c891e56b6795

5 years agoFix typo in McrSchemaOverride
Aaron Schulz [Wed, 20 Mar 2019 03:35:51 +0000 (20:35 -0700)]
Fix typo in McrSchemaOverride

Change-Id: Ifedb6276d9b4188e2aacacf38bf608f7ea36201b

5 years agoMerge "Fix selectRow() parameters in PopulateCategory"
jenkins-bot [Wed, 20 Mar 2019 02:15:55 +0000 (02:15 +0000)]
Merge "Fix selectRow() parameters in PopulateCategory"

5 years agoMerge "Make BackupDumper MCR compatible (main slot only)"
jenkins-bot [Wed, 20 Mar 2019 02:15:43 +0000 (02:15 +0000)]
Merge "Make BackupDumper MCR compatible (main slot only)"

5 years agoMerge "Move the "v1" to an adjacent key component in Title::loadRestrictions"
jenkins-bot [Wed, 20 Mar 2019 02:13:51 +0000 (02:13 +0000)]
Merge "Move the "v1" to an adjacent key component in Title::loadRestrictions"

5 years agostorage: Fix typo in NameTableStore::purgeWANCache comments
Aaron Schulz [Tue, 19 Mar 2019 16:28:40 +0000 (09:28 -0700)]
storage: Fix typo in NameTableStore::purgeWANCache comments

Change-Id: Icdea7422cdb110877bb8991896e6ab8a83b02858

5 years agoMerge "Replace 'TablePager' CSS class exclusively by `mw-datatable`"
jenkins-bot [Wed, 20 Mar 2019 01:28:24 +0000 (01:28 +0000)]
Merge "Replace 'TablePager' CSS class exclusively by `mw-datatable`"

5 years agoMove the "v1" to an adjacent key component in Title::loadRestrictions
Aaron Schulz [Wed, 20 Mar 2019 01:21:18 +0000 (18:21 -0700)]
Move the "v1" to an adjacent key component in Title::loadRestrictions

This keeps the WAN cache statsd metrics under page-restrictions as before

Change-Id: I30b716cbc362c98f09ba77a4b3f68a821d966d44

5 years agoImprove Caching in Title::loadRestrictions()
Andrew Green [Tue, 19 Mar 2019 22:16:11 +0000 (16:16 -0600)]
Improve Caching in Title::loadRestrictions()

Change-Id: I9a7edf6fc7d0bb0f4129fe13323964e9fae791f3

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 19 Mar 2019 20:54:09 +0000 (21:54 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I1b714edba904187e6b39f9e26f54b40f567453e7

5 years agoMerge "jquery.tablesorter: Never initialize twice on the same element"
jenkins-bot [Tue, 19 Mar 2019 20:09:14 +0000 (20:09 +0000)]
Merge "jquery.tablesorter: Never initialize twice on the same element"

5 years agoMerge "Remove block cookie stats measurement implementation"
jenkins-bot [Tue, 19 Mar 2019 19:35:57 +0000 (19:35 +0000)]
Merge "Remove block cookie stats measurement implementation"

5 years agojquery.tablesorter: Never initialize twice on the same element
Ed Sanders [Wed, 13 Mar 2019 19:26:05 +0000 (19:26 +0000)]
jquery.tablesorter: Never initialize twice on the same element

Change-Id: I06725e62b2ee95e2d1d37348a633f9cbc156318d

5 years agoFix selectRow() parameters in PopulateCategory
Aaron Schulz [Tue, 19 Mar 2019 18:36:19 +0000 (11:36 -0700)]
Fix selectRow() parameters in PopulateCategory

Change-Id: Ib538657d5db889cd7c8a9ae694c60e92e13584f5

5 years agoMerge "Remove many references to db fields being retired as part of MCR Schema Migration"
jenkins-bot [Tue, 19 Mar 2019 18:09:30 +0000 (18:09 +0000)]
Merge "Remove many references to db fields being retired as part of MCR Schema Migration"

5 years agoMerge "debug: Disable flaky CeeFormatterTest"
jenkins-bot [Tue, 19 Mar 2019 16:39:34 +0000 (16:39 +0000)]
Merge "debug: Disable flaky CeeFormatterTest"

5 years agoMerge "Sync up with Parsoid parserTests.txt"
jenkins-bot [Tue, 19 Mar 2019 16:25:26 +0000 (16:25 +0000)]
Merge "Sync up with Parsoid parserTests.txt"

5 years agoRemove many references to db fields being retired as part of MCR Schema Migration
Bill Pirkle [Fri, 15 Mar 2019 15:59:41 +0000 (10:59 -0500)]
Remove many references to db fields being retired as part of MCR Schema Migration

Remove many references to database fields rev_text_id and ar_text_id,
which are being retired as part of MCR Schema Migration.
Some references remain, and will be removed under other patchsets
or other tasks.

Bug: T198341
Change-Id: Id044b8dcd7c9d09d5d6037eb732f6a105933f516

5 years agoMerge "rdbms: add bad mysql table/column codes to wasKnownStatementRollbackError()"
jenkins-bot [Tue, 19 Mar 2019 15:36:09 +0000 (15:36 +0000)]
Merge "rdbms: add bad mysql table/column codes to wasKnownStatementRollbackError()"

5 years agoSync up with Parsoid parserTests.txt
Arlo Breault [Tue, 19 Mar 2019 15:33:40 +0000 (11:33 -0400)]
Sync up with Parsoid parserTests.txt

This now aligns with Parsoid commit 94b8b491098f882582f372218df07f5b68f4eba1

Change-Id: I760e73c98109047e20e4c85b97853b9b3f50b090

5 years agodebug: Disable flaky CeeFormatterTest
Timo Tijhof [Tue, 19 Mar 2019 15:25:18 +0000 (15:25 +0000)]
debug: Disable flaky CeeFormatterTest

Follows-up 667b17a3193f0af0.

Bug: T218688
Change-Id: I70afc5b9c41ae8d593d71f27bc55b424d9de260c

5 years agoRemove block cookie stats measurement implementation
Dayllan Maza [Tue, 19 Mar 2019 15:12:08 +0000 (11:12 -0400)]
Remove block cookie stats measurement implementation

When setting a cookie on IP blocks was rolled out we wanted to
add some form of measurement to keep an eye on it. This patch is
removing that implementation 'cause it is not needed anymore.

Bug: T218596
Change-Id: I33ee164157b539560a3d88c6f3018dc013218640

5 years agoMerge "Revert "Split out new RefreshSecondaryDataUpdate class""
jenkins-bot [Tue, 19 Mar 2019 15:06:46 +0000 (15:06 +0000)]
Merge "Revert "Split out new RefreshSecondaryDataUpdate class""

5 years agoRevert "Split out new RefreshSecondaryDataUpdate class"
Timo Tijhof [Tue, 19 Mar 2019 03:01:43 +0000 (03:01 +0000)]
Revert "Split out new RefreshSecondaryDataUpdate class"

This reverts commits a1f7fd3adaa30ef02cd018901.

Bug: T218456
Change-Id: I9bbea3d13460ed44755d77fc61ff23fb906cf71e

5 years agoMerge "parser: Rename $lastSection to $lastParagraph"
jenkins-bot [Tue, 19 Mar 2019 14:37:54 +0000 (14:37 +0000)]
Merge "parser: Rename $lastSection to $lastParagraph"

5 years agoMerge "Revert "Temporarily trim leading/trailing whitespace from parser test clauses""
jenkins-bot [Tue, 19 Mar 2019 14:37:48 +0000 (14:37 +0000)]
Merge "Revert "Temporarily trim leading/trailing whitespace from parser test clauses""

5 years agoMerge "parser: Omit outputting newline after final line"
jenkins-bot [Tue, 19 Mar 2019 14:37:16 +0000 (14:37 +0000)]
Merge "parser: Omit outputting newline after final line"

5 years agoMerge "Remove rollback confirmation user preference"
jenkins-bot [Tue, 19 Mar 2019 14:36:36 +0000 (14:36 +0000)]
Merge "Remove rollback confirmation user preference"

5 years agoMerge "parser: Remove trailing newline after prefixes have been cleared"
jenkins-bot [Tue, 19 Mar 2019 14:18:30 +0000 (14:18 +0000)]
Merge "parser: Remove trailing newline after prefixes have been cleared"

5 years agoMerge "Temporarily trim leading/trailing whitespace from parser test clauses"
jenkins-bot [Tue, 19 Mar 2019 14:18:22 +0000 (14:18 +0000)]
Merge "Temporarily trim leading/trailing whitespace from parser test clauses"

5 years agoRemove rollback confirmation user preference
Tim Eulitz [Mon, 18 Mar 2019 13:40:09 +0000 (14:40 +0100)]
Remove rollback confirmation user preference

Due to a delay in the rollout of this feature, this part of the code has
to be temporarily removed again to prevent an unused setting from
popping up in the user settings.

Bug: T218556
Change-Id: I0f4e822fc25fddc2bc3c0b55b0792799a1e4c4ba

5 years agoMerge "Improve RemexStripTagHandler working with tables"
jenkins-bot [Tue, 19 Mar 2019 04:25:47 +0000 (04:25 +0000)]
Merge "Improve RemexStripTagHandler working with tables"

5 years agordbms: add bad mysql table/column codes to wasKnownStatementRollbackError()
Aaron Schulz [Tue, 19 Mar 2019 03:22:59 +0000 (20:22 -0700)]
rdbms: add bad mysql table/column codes to wasKnownStatementRollbackError()

Change-Id: I826681ae7582b6f8af09b1d5ed08378532af2556

5 years agoMerge "Use READ_EXCLUSIVE in SpecialConfirmEmail::attemptConfirm"
jenkins-bot [Tue, 19 Mar 2019 02:30:21 +0000 (02:30 +0000)]
Merge "Use READ_EXCLUSIVE in SpecialConfirmEmail::attemptConfirm"

5 years agoMerge "rdbms: document that IDatabase::selectFieldValues() keeps the order"
jenkins-bot [Tue, 19 Mar 2019 02:30:11 +0000 (02:30 +0000)]
Merge "rdbms: document that IDatabase::selectFieldValues() keeps the order"

5 years agoMerge "Make BagOStuff::incr abstract to discourage bad implementations"
jenkins-bot [Tue, 19 Mar 2019 01:45:48 +0000 (01:45 +0000)]
Merge "Make BagOStuff::incr abstract to discourage bad implementations"

5 years agoMerge "Define ManualLogEntryBeforePublish hook"
jenkins-bot [Tue, 19 Mar 2019 00:09:28 +0000 (00:09 +0000)]
Merge "Define ManualLogEntryBeforePublish hook"

5 years agoMerge "Replace $wgUser with RequestContext::getUser in User::getBlockedStatus"
jenkins-bot [Mon, 18 Mar 2019 23:52:33 +0000 (23:52 +0000)]
Merge "Replace $wgUser with RequestContext::getUser in User::getBlockedStatus"

5 years agoDefine ManualLogEntryBeforePublish hook
Piotr Miazga [Wed, 13 Mar 2019 20:16:39 +0000 (21:16 +0100)]
Define ManualLogEntryBeforePublish hook

This hook is required by extensions like MobileFrontend to tag
log entries when actions are performed on the mobile web.

There is a possibility to tag log entries by using
'RecentChange_save' hook, but that works only when the log entry
is published to 'rc' or 'rcandudp'. This means, that tagged log
will appear also on the Special:RecentChanges page which is something
what extensions like 'Thanks' wants to avoid.

In the future we should avoid using 'RecentChange_save' as an
indirect way to tag log entries, and use the
'ManualLogEntryBeforePublish' hook instead.

To cover ourselves in the future, instead of passing &$tags only,
we pass the $this (the log entry object) so extensions can perform
additional checks before using setTags().

Bug: T215675
Change-Id: I747eded4bc5406cd5d4676fc93b0bb55c99f9a4d

5 years agoReplace $wgUser with RequestContext::getUser in User::getBlockedStatus
Gergő Tisza [Mon, 18 Mar 2019 21:50:48 +0000 (14:50 -0700)]
Replace $wgUser with RequestContext::getUser in User::getBlockedStatus

$wgUser is not guaranteed to exist until MediaWiki has been fully
initialized; block status needs to be checked early on for
authentication-related permission checks.

Bug: T218608
Change-Id: I16315c071855024bc0412d5360c95f843420d9a9

5 years agoMake BagOStuff::incr abstract to discourage bad implementations
Aaron Schulz [Mon, 18 Mar 2019 23:09:26 +0000 (16:09 -0700)]
Make BagOStuff::incr abstract to discourage bad implementations

Callers should really use atomic TTL-preserving implementations
so that calling code works correctly. The old default base class
code did not do either.

Change-Id: Icf66db05e48b86c8d481dc08dc9041bd1fa6dbe9

5 years agoMerge "Make DeferredUpdates enqueue updates that failed to run when possible"
jenkins-bot [Mon, 18 Mar 2019 23:02:58 +0000 (23:02 +0000)]
Merge "Make DeferredUpdates enqueue updates that failed to run when possible"

5 years agoMerge "Provide a Taggable interface"
jenkins-bot [Mon, 18 Mar 2019 22:47:44 +0000 (22:47 +0000)]
Merge "Provide a Taggable interface"

5 years agoProvide a Taggable interface
Piotr Miazga [Thu, 28 Feb 2019 17:24:10 +0000 (18:24 +0100)]
Provide a Taggable interface

The Taggable interface defines how to tag objects in MediaWiki.
For now there are only two Taggable objects:
 - RecentChange
 - ManualLogEntries

This interface should be used in places where we want to optionally
tag things, for example:
 We want to tag all mobile web actions with 'web mobile edit'.

With that interface, we will be able to expect a Taggable object,
and call `addTags()` when we need to, without having a special check
to verify is it RecentChange, or is it ManualLogEntry. We will only
expect a Taggable object.

Additionally, added @deprecated note to ManualLogEntries::setTags()
as each call to this method will override all previous tags. This
action can be harmfull to parts of code that conditionally add tags.
If object was tagged in some way, we should preserve those tags.

If there are any special cases, where we want to override all tags,
we should provide `resetTags()` method.

Bug: T215675
Change-Id: Ia4c019db8ca6f37ce0f86bf7d134d6f1713daf56

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 18 Mar 2019 21:55:09 +0000 (22:55 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I7dea9fd7d9892ea16a33bf020f22957dbe29549c

5 years agoMerge "Mixin FlaggedElement to DateTimeInputWidget"
jenkins-bot [Mon, 18 Mar 2019 21:25:59 +0000 (21:25 +0000)]
Merge "Mixin FlaggedElement to DateTimeInputWidget"

5 years agoMerge "Urlencode fragments when redirecting after editing"
jenkins-bot [Mon, 18 Mar 2019 20:55:58 +0000 (20:55 +0000)]
Merge "Urlencode fragments when redirecting after editing"

5 years agoMixin FlaggedElement to DateTimeInputWidget
Daimona Eaytoy [Mon, 18 Mar 2019 10:07:59 +0000 (11:07 +0100)]
Mixin FlaggedElement to DateTimeInputWidget

As consequence of Id46ca3b630a9d24bc4790c1aa8c6e15c95ea2e51.

Bug: T218513
Change-Id: Iaf1078971767224119138e47bb175094230c99a2

5 years agoUrlencode fragments when redirecting after editing
Max Semenik [Mon, 18 Mar 2019 05:42:42 +0000 (22:42 -0700)]
Urlencode fragments when redirecting after editing

This is a quick fix for the main symptom of the Chrome bug that results in
users being redirected to Special:BadTitle after section editing. We'll
need to discuss a more permanent solution.

Bug: T216029
Change-Id: I4b2d42ebc74031df86bc52310da71819da11c1ae

5 years agoMerge "Password: update documentation"
jenkins-bot [Mon, 18 Mar 2019 01:07:10 +0000 (01:07 +0000)]
Merge "Password: update documentation"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 17 Mar 2019 20:54:44 +0000 (21:54 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I2d4ac09f82c79444730cf9cf0c8f01fc5109b917

5 years agoPassword: update documentation
Max Semenik [Sun, 17 Mar 2019 19:44:19 +0000 (12:44 -0700)]
Password: update documentation

Change-Id: Ifd7afc48e301a7985c2dd9134a7ea75af9bfeb4b

5 years agoMerge "Make LinkCache::isCacheable include namespaces like NS_CATEGORY/NS_MODULE"
jenkins-bot [Sun, 17 Mar 2019 18:49:05 +0000 (18:49 +0000)]
Merge "Make LinkCache::isCacheable include namespaces like NS_CATEGORY/NS_MODULE"

5 years agoMerge "Advertise feeds only if $wgFeed is enabled"
jenkins-bot [Sun, 17 Mar 2019 16:33:19 +0000 (16:33 +0000)]
Merge "Advertise feeds only if $wgFeed is enabled"

5 years agorunJobs.php output something when the job queue is empty
RazeSoldier [Sun, 18 Feb 2018 17:31:29 +0000 (01:31 +0800)]
runJobs.php output something when the job queue is empty

If the job queue is empty, output "Job queue is empty."

Bug: T187628
Change-Id: I7d0925bd2995526b1a67148096e9543766a62da7

5 years agoUse READ_EXCLUSIVE in SpecialConfirmEmail::attemptConfirm
Aaron Schulz [Sun, 17 Mar 2019 05:35:43 +0000 (22:35 -0700)]
Use READ_EXCLUSIVE in SpecialConfirmEmail::attemptConfirm

Bug: T202149
Change-Id: I9abc9e653dcc0910a5eea1dad56b2432d33d3c44

5 years agoAdvertise feeds only if $wgFeed is enabled
saper [Sun, 28 Jan 2018 02:21:51 +0000 (03:21 +0100)]
Advertise feeds only if $wgFeed is enabled

Wikis with $wgFeed=false should not present an Atom icon on the RecentChanges/Watchlist.

Bug: T116145
Change-Id: Ic64f7f5115a77c42ed2b336f6996fe711b3822ba

5 years agoMerge "RELEASE-NOTES: Make more consistent and useful for sysadmins"
jenkins-bot [Sat, 16 Mar 2019 22:54:32 +0000 (22:54 +0000)]
Merge "RELEASE-NOTES: Make more consistent and useful for sysadmins"

5 years agoMerge "Various fixes for phan-taint-check"
jenkins-bot [Sat, 16 Mar 2019 22:12:55 +0000 (22:12 +0000)]
Merge "Various fixes for phan-taint-check"

5 years agoMerge "ProtectionForm: Follow up on I167ae6300b37d4e9292"
jenkins-bot [Sat, 16 Mar 2019 22:03:25 +0000 (22:03 +0000)]
Merge "ProtectionForm: Follow up on I167ae6300b37d4e9292"

5 years agoMerge "rdbms: improve database connection loss handling"
jenkins-bot [Sat, 16 Mar 2019 21:23:36 +0000 (21:23 +0000)]
Merge "rdbms: improve database connection loss handling"

5 years agoRELEASE-NOTES: Make more consistent and useful for sysadmins
James D. Forrester [Fri, 15 Mar 2019 00:58:24 +0000 (17:58 -0700)]
RELEASE-NOTES: Make more consistent and useful for sysadmins

* Move the "upgrading" bit further up, and put the notes specific
  to upgrading inside it.
* Word all configuration changes to start with the $wg… – rubric
  so they're easy to spot.
* Be explicit when new configuration options are temporary.
* Split user and developer features. Sysadmin features are what
  the "Configuration changes" section is for, so spell that out.

Change-Id: Id12ced8bb764f2c3945c14799d63c17e2711c6f6

5 years agoVarious fixes for phan-taint-check
Brian Wolff [Sun, 17 Feb 2019 11:47:41 +0000 (11:47 +0000)]
Various fixes for phan-taint-check

Change-Id: I56f42ef2d2e9b4f3c23e1e93d1a4d3db64f16de7

5 years agoProtectionForm: Follow up on I167ae6300b37d4e9292
Derick Alangi [Mon, 11 Mar 2019 09:34:23 +0000 (10:34 +0100)]
ProtectionForm: Follow up on I167ae6300b37d4e9292

Per code search string "\$this\-\>showLogExtract\( \$ou", method
is only called within the ProtectionForm class so can be safely
made private but there are methods with the same name in a class
like LogEventsList but do different things.

Inspired by @Thiemo's comment on I167ae6300b37d4e9292.

Change-Id: Ic4983ccffecc6285f848d6e926017c4c6df4855f

5 years agoCode style tweaks
Jack Phoenix [Fri, 15 Mar 2019 23:13:36 +0000 (01:13 +0200)]
Code style tweaks

Change-Id: I2c602ba642e5692e6c56817aac89be9058bf5bdb

5 years agoMake LinkCache::isCacheable include namespaces like NS_CATEGORY/NS_MODULE
Aaron Schulz [Thu, 14 Mar 2019 06:44:38 +0000 (23:44 -0700)]
Make LinkCache::isCacheable include namespaces like NS_CATEGORY/NS_MODULE

Category and module pages are some of the most frequently referenced

Change-Id: I6d29e883883cbea596b287494e75663d09130749

5 years agoMerge "User: Remove redundant wgClockSkewFudge code"
jenkins-bot [Sat, 16 Mar 2019 03:03:28 +0000 (03:03 +0000)]
Merge "User: Remove redundant wgClockSkewFudge code"