Commit graph

5561 commits

Author SHA1 Message Date
jenkins-bot
86bf710e44 Merge "Allow users to block the user that blocked them." 2018-12-09 23:47:25 +00:00
Brian Wolff
6585277528 Allow users to block the user that blocked them.
This is to make it so that blocking all other admins is not
a succesful attack plan, as the blocked admins can block the
blocker, and then it ends in a stalemate with everyone blocked.

This also allows users with unblock-self right to adjust their
own blocks. The code already existed for this but was broken.

Credit for this idea goes to Tgr.

Bug: T150826
Change-Id: I0418279fdb2a59f8f1d7eeb8931d874123d03e4f
2018-12-09 15:24:57 -08:00
jenkins-bot
bd78869618 Merge "No yoda conditions" 2018-12-09 01:34:23 +00:00
jenkins-bot
c90f3220a3 Merge "monolog: add CeeFormatter" 2018-12-07 21:24:17 +00:00
Filippo Giunchedi
667b17a319 monolog: add CeeFormatter
This formatter extends LogstashFormatter to prefix records with "cee token"
used for syslog and JSON structured logging. See also related task for more
context.

Bug: T211124
Change-Id: I3cdeb4c666f54039b5e8ecc67bd4937220333526
2018-12-07 09:04:54 +01:00
jenkins-bot
41fa0b12e7 Merge "ApiComparePages: Don't try to find next/prev of a deleted revision" 2018-12-06 18:19:39 +00:00
jenkins-bot
5417327be0 Merge "Don't silently fail if API result fails to encode" 2018-12-05 20:15:04 +00:00
jenkins-bot
9ff8e0a946 Merge "Remove most support for configuring Tidy, including Raggett" 2018-12-05 18:59:50 +00:00
C. Scott Ananian
afd3dbaa95 Don't silently fail if API result fails to encode
Ensure that errors encoding API results produce actionable log entries.

Part of the follow-up to T210550.

Change-Id: I6f311451e3b07b540f14352ce25af9d74a053d19
2018-12-05 13:28:33 -05:00
jenkins-bot
3da3519967 Merge "PasswordPbkdf2: remove the 'use-hash-extension' option" 2018-12-04 06:52:15 +00:00
jenkins-bot
aae7ba949a Merge "Don't link wikilinks in section heading autocomments" 2018-12-03 21:35:28 +00:00
jenkins-bot
952d53d7b1 Merge "Restore old HTML structure for history section links" 2018-12-03 21:35:16 +00:00
jenkins-bot
b9333ae655 Merge "RevisionStore: Avoid exception on prev/next of deleted revision" 2018-12-03 21:07:44 +00:00
Kunal Mehta
1706d353ae Don't link wikilinks in section heading autocomments
Previously, a manually constructed autocomment in the form of
/* [[Some link]] */

would create a link to the the section, and then the "Some link" page.

After T165189 was implemented, the entire autocomment is now a link to
the section, so we're creating links inside of a link...which is
problematic. In most contexts (history and watchlist particularly), the
section link is more important than the title in the section heading, so
that's what we'll favor here.

It's worth noting that this situation is a manually created edge case.
Even if the section heading is a wikilink, the edit summary will
autofill a section autocomment without the double brackets.

We'll now render the double brackets ([[...]]) and not link them. This
is what the user literally typed, and matches the existing practice of
rendering templates in section headings with their literal syntax. And
as a bonus, it's still possible for user scripts such as wikEdDiff to
turn the rendered double brackets into a real link if users want.

Bug: T165189
Change-Id: Ib10679edd76c72a60d7e1c89fc8454166e34c463
2018-12-03 12:43:03 -08:00
Kunal Mehta
0c9cf24b05 Restore old HTML structure for history section links
A follow-up to 0a8e16d7cf thanks to Anomie's code review.

The section title is now inside <span dir="auto"> and <span
class="autocomment">, as before. $wgLang->getDirMark() between the arrow
and the text was restored.

Given the comment
 /* External links */ removed bogus entries
the HTML before 0a8e16d7cf looked like:
 <a href="#External_links">→</a>‎<span dir="auto"><span
 class="autocomment">External links: </span> removed bogus entries</span>
after this change, it will look like:
 <span dir="auto"><span class="autocomment"><a
 href="#External_links">→‎External links</a>: </span> removed bogus
 entries</span>

The issue of having links be inside other links will be addressed in a
separate patch.

Bug: T165189
Change-Id: I31d87a87ccaf50de58fdd0621c46133b2881b490
2018-12-03 12:42:56 -08:00
Brad Jorsch
3c95d3bdd9 ApiComparePages: Don't try to find next/prev of a deleted revision
RevisionStore::getPreviousRevision() and ::getNextRevision() don't
handle being passed a RevisionArchiveRecord very well. Even if they
would, it's not clear whether the user wants to be comparing with the
next/previous deleted revision or the next/previous revision even if not
deleted. So let's just make it an error, at least for now.

Bug: T208929
Change-Id: I151019e336bda92aa4040ba4162eb2588c909652
2018-12-03 15:31:34 -05:00
jenkins-bot
023fec5d7b Merge "[MCR] Introduce SlotRoleHandler and SlotRoleRegistry" 2018-12-03 16:20:06 +00:00
jenkins-bot
d87022e544 Merge "Revert "Title::checkUserBlock should call User::isBlockedFrom for every action"" 2018-12-03 01:57:50 +00:00
Legoktm
91fc748030 Revert "Title::checkUserBlock should call User::isBlockedFrom for every action"
This reverts commit b1e4ca70b8.

Introduced a breaking change, and didn't follow the deprecation policy.

Bug: T210953
Change-Id: I11806165912d9188261d3c4c37dbae5cfd2865ec
2018-12-03 00:12:19 +00:00
Max Semenik
9c4ce7e1cf PasswordPbkdf2: remove the 'use-hash-extension' option
It's misleading because even with this option the Hash extension is
still required due to usage of hash_hmac(), it's just to allow this
class to work on pre-5.5 PHP that had hash_hmac() but not hash_pbkdf().
Since we require 7.0, this option doesn't do anything anymore.

Change-Id: Ib60ab9377b44d78b7147c6139b07dc5467da007c
2018-11-30 18:21:03 -08:00
daniel
db987c700a [MCR] Introduce SlotRoleHandler and SlotRoleRegistry
These new classes provide a mechanism for defining the
behavior of slots, like the content models it supports.
This acts as an extension point for extensions that need
to define custom slots, like the MediaInfo extension
for the SDC project.

Bug: T194046
Change-Id: Ia20c98eee819293199e541be75b5521f6413bc2f
2018-11-30 12:29:05 -08:00
jenkins-bot
366f5d69c1 Merge "Use ParserCache in CategoryMembershipChangeJob" 2018-11-29 01:15:01 +00:00
jenkins-bot
32b573187d Merge "Drop $wgChangeTagsSchemaMigrationStage" 2018-11-28 23:52:00 +00:00
Amir Sarabadani
02a930d7fb Drop $wgChangeTagsSchemaMigrationStage
Bug: T194163
Change-Id: Ieb6cc60cacf9dd0d86641b1be817249cdce42112
2018-11-28 23:03:41 +01:00
Brad Jorsch
fd5a1842d2 Default $wgCommentTableSchemaMigrationStage to MIGRATION_NEW
WRITE_NEW mode seems to be working well on Wikimedia sites. Let's change
the default to MIGRATION_NEW so existing installs and Wikimedia CI will
start using the new code rather than the old.

This also fixes some unit tests that were broken with MIGRATION_NEW, and
updates some that were forcing MIGRATION_OLD to force MIGRATION_NEW
instead.

Bug: T166733
Change-Id: I7bf4ad0105dd1f6cc49eba3ddcb7a51badcd5ed3
Depends-On: I30f7cdcc3875f3f7af116c1e41e88f62ab9e91d0
2018-11-28 13:59:19 -05:00
daniel
4268545b4d Use ParserCache in CategoryMembershipChangeJob
Note that we will still be re-parsing either the old or the new
revision. Keeping the rendered version of the old revision cached
for a bit would be nice, but ParserCache currently does not
support this.

Bug: T205369
Change-Id: I86d26e494924eec24e7b1fb32c424ac1284be478
2018-11-27 15:46:14 -08:00
jenkins-bot
38850661fb Merge "Fix global variable name typo in LocalIdLookupTest.php" 2018-11-27 21:14:52 +00:00
Alangi Derick
edc11af725 Fix global variable name typo in LocalIdLookupTest.php
Per @Thiemo and @Anomie's comments on the patch, droppping dependency
of the test value to not be a global, using "dummy" in this case.

Bug: T210512
Change-Id: I26aff5fe4782837a8f52a102ae1bdbac49b748bc
2018-11-27 19:47:29 +00:00
jenkins-bot
11cdc836e7 Merge "API: Add exception class as data to internal_api_error codes" 2018-11-27 19:14:12 +00:00
jenkins-bot
fe2ca43a0c Merge "API: Validate API error codes" 2018-11-27 19:08:25 +00:00
David Barratt
93a894a8b3
Do not ignore the 'Prevent this user from editing his own talk page while
blocked' option on partial blocks.

Partial blocks currently ignore this option as it gets into an edge case. The
option should take precidence if it is true, but should be ignored if it is
false. On sitewide blocks, the option should always be honored.

Bug: T210475
Change-Id: I33177b48a5c261ec3f510ce01998c1b096077b85
2018-11-27 10:30:21 -05:00
jenkins-bot
3142b1b379 Merge "rdbms: rename setDomainPrefix to setLocalDomainPrefix in ILoadBalancer" 2018-11-27 00:27:32 +00:00
jenkins-bot
cbe2931d23 Merge "Use stashed ParserOutput during saving." 2018-11-26 22:53:34 +00:00
daniel
6a9497769c RevisionStore: Avoid exception on prev/next of deleted revision
This makes RevisionStore a bit more robust against use with deleted
revisions.

Note that this does not make I151019e336bda redundant, since detecting
this situation early and providing meaningful error message is useful.

Bug: T208929
Change-Id: I7635ddc0176e21d873eacadebe02603b1fe51c38
2018-11-26 13:53:56 -08:00
Brad Jorsch
c765b4e37c API: Add exception class as data to internal_api_error codes
The code for all uncaught exceptions will in the future be
"internal_api_error". If the client needs to know the class name for
some reason, it can check the new 'errorclass' data item on the error.

Change-Id: Ia9e32bbb8d17692203f4fbcee53a20e87be1776e
2018-11-26 13:42:07 -05:00
Brad Jorsch
4eace785e6 API: Validate API error codes
Validate them in ApiMessageTrait when the message is created, and again
in ApiMain before they're included in the header.

This also introduces an "api-warning" log channel, since "api" is too
spammy for real use, and converts a few existing things to use it.

Bug: T208926
Change-Id: Ib2d8bd4d4a5d58af76431835ba783c148de7792a
Depends-On: Iced44f2602d57eea9a2d15aee5b8c9a50092b49c
Depends-On: I5c2747f527c30ded7a614feb26f5777d901bd512
Depends-On: I9c9bd8f5309518fcbab7179fb71d209c005e5e64
2018-11-26 18:41:08 +00:00
Aaron Schulz
d2e1734390 rdbms: rename setDomainPrefix to setLocalDomainPrefix in ILoadBalancer
Update CloneDatabase and unit test callers, which are the only things
that are likely to call it.

Change-Id: Idbc6d2965cd3828c2c6d23012319bbf0fc3ffa4a
2018-11-26 10:38:15 -08:00
jenkins-bot
98fd48b57b Merge "rdbms: add ILBFactory::redefineLocalDomain method" 2018-11-26 16:51:39 +00:00
Reedy
519ff1a402 Add PasswordPolicy to check the password isn't in the large blacklist
Add wikimedia/password-blacklist 0.1.3, which contains 100,000 common passwords

Bug: T151425
Change-Id: I80572fcee6d23ea04ad9ee683157bab9378b660e
Depends-On: I8aea5a44248da9bb9ff7b328679bff6fcf41750d
2018-11-24 15:46:14 -08:00
Bjornskjald
0a8e16d7cf Make "→" link to page section on History page larger by adding section name to it
Bug: T165189
Change-Id: I1f845592bd3de342fda84b60fc412055973950fd
2018-11-24 03:22:16 +00:00
Aaron Schulz
1c205f1822 rdbms: add ILBFactory::redefineLocalDomain method
This is intended for use with scripts like addWiki.php to avoid mismatched domain errors.

Bug: T209483
Change-Id: Ie24f83f4e0fad7b01690d2055e1529a4cb0275b5
2018-11-22 23:51:44 -08:00
daniel
8c5cb4b1a7 Use stashed ParserOutput during saving.
The code in DerivedPageDataUpdater that used the stashed ParserOutput from
ApiStashEdit::checkCache was accidentally broken when RevisionRenderer
was introduced in I871978bf79f67c9e7954fb3fc8528d6e365f2cc1.

This is likely the cause for the degraded save timing noted in T205369.

Bug: T205369
Change-Id: I6d8fdda73dccae08d18bfb528b948706f56ad2e0
2018-11-22 08:08:13 +01:00
Fomafix
3ee1560232 No yoda conditions
Replace
  if ( 42 === $foo )
by
  if ( $foo === 42 )

Change-Id: Ice320ef1ae64a59ed035c20134326b35d454f943
2018-11-21 17:54:39 +01:00
jenkins-bot
d79f256590 Merge "Fix partial block translation for non-editing msg" 2018-11-20 00:41:00 +00:00
jenkins-bot
1db4c42f46 Merge "Block: Clean up handling of non-User targets" 2018-11-19 23:56:17 +00:00
jenkins-bot
d7066ad8c2 Merge "Action::checkCanExecute should only block an Action if the user is sitewide blocked" 2018-11-19 22:39:39 +00:00
jenkins-bot
6882d2dab8 Merge "Title::checkUserBlock should call User::isBlockedFrom for every action" 2018-11-19 22:24:03 +00:00
jenkins-bot
b20e9ed0b9 Merge "Reuse DerivedPageDataUpdater during null-edits." 2018-11-17 02:03:43 +00:00
daniel
b8e58c039a Reuse DerivedPageDataUpdater during null-edits.
Checking the acting user against the revision's author in
DerivedPageDataUpdater::isReusableFor would lead to false
negatives.

Also removes a check of the current acting user against the
cached revision's author, for the same reason: for null edits,
the acting user and the revision author are unrelated.

Bug: T205369
Change-Id: I48f59dce6c25062b3d6ff4248e1171269766c507
2018-11-16 18:58:54 +01:00
Agabi10
4985ce5134 Add a way to exclude categories from Special:UnusedCategories
Added __EXPECT_UNUSED_CATEGORY__ as a behavioral switch. Adding
this switch to category pages prevents them from appearing in
Special:UnusedCategories.

Bug: T96041
Change-Id: I055e59f5311347155e0f801dd5ec9a6d4a68c9cc
2018-11-16 13:32:27 +00:00