Creates a notification type to notify users when their
user page is edited.
Co-authored-by: Kunal Mehta <legoktm@debian.org>
Co-authored-by: Ed Sanders <esanders@wikimedia.org>
Bug: T3876
Change-Id: Ibe0092a96d96f6fa9d93991418b723f3e70e1b75
Instead of turning the array keys into an array of strings and
searching that we can access the original array by key.
Change-Id: Id4fddd242cff66ee70fa1cc07cdcb6938482696c
Comments has been duplicating these methods for quite some time for no real reason other than that they're private here.
Duplicating these methods appears to be necessary if and when working with extensions where users can be @mentioned but which are
not implemented as ContentHandler subclasses or otherwise related to regular wikitext pages.
Change-Id: I9c097bab9c5eed8f2399c86897b1f8968126c765
The section titles are wikitext extracted from inside heading markup
like `== … ==`, so start-of-line markup like `*` should not be parsed.
Bug: T299572
Change-Id: Ie3995b943e5fe20ad86041d6be755f14f32eb01e
ContentHandler::getContentText() is deprecated and should be
replaced with Content::getText() for TextContent instances.
Change-Id: Ia92c5a41954b1d21deb39dcafabbdff60a414f55
Collect event data and allow modification by a hook.
This allows extensions to look at the events generated so far,
add more events, or remove events.
Bug: T276990
Change-Id: I60818d57552946857077dee93b0adb036621b791
Remove using of User::getCanonicalName since this method will be hard-deprecated. Now it is soft-deprecated
Bug: T275030
Change-Id: Id708800bc709de175bc7c6acc422368a734b00f1
Remove using of User::isIP since this method will be hard-deprecated. Now it is soft-deprecated
Bug: T275602
Change-Id: Ic1749cbad92bfe0eeae40736403fd5ceb6d504e8
It appears like the initial \h in this non-Unicode regular
expression matches parts of an UTF-8 character, destroying it.
This makes the final preg_match() in this method fail, when
$output is going to be used as a pattern.
Bug: T264922
Change-Id: Iaf240bc2e0808c2f57c1f8bab2589d3207915afe
ParserOptions::setTidy() was already a no-op in MW 1.35, and
Echo already requires MW >= 1.35 in extension.json.
ParserOptions::setTidy() was deprecated in MW 1.35 and will be removed
in a future release.
Bug: T198214
Change-Id: I6a5378a42a6cf035296ad549525c25438803970a
DiscussionParser::getUserMentions() returns mentions in an array of the
form [ID => ID]. UserLocator says "we shouldn't receive User instances,
but allow it for backward compatability". But
DiscussionParser::generateEventsForRevision() was putting User objects
into the extra when there is a mention in the edit summary.
I noticed this when I accidentally made User objects be unserializable
in a core patch.
So, I made generateEventsForRevision() generate mention arrays in the
same ID=>ID format as getUserMentions().
Change-Id: I7c6d25950c8887b50426863c7b0a2d5d007559dd
Instead of returning false when no links in the user namespace are
found, return an empty array. They're both falsey, but this way we don't
break the type hint in generateMentionEvents(), which is the only thing
that getUserLinks() is used for anyway.
Bug: T239275
Change-Id: I93b320be07cfdae68c5e296b2caa62ea4fae5ff2