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
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
Ensure that errors encoding API results produce actionable log entries.
Part of the follow-up to T210550.
Change-Id: I6f311451e3b07b540f14352ce25af9d74a053d19
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
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
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
This reverts commit b1e4ca70b8.
Introduced a breaking change, and didn't follow the deprecation policy.
Bug: T210953
Change-Id: I11806165912d9188261d3c4c37dbae5cfd2865ec
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
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
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
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
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
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
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
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
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
This is intended for use with scripts like addWiki.php to avoid mismatched domain errors.
Bug: T209483
Change-Id: Ie24f83f4e0fad7b01690d2055e1529a4cb0275b5
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
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
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