mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-09-24 19:08:16 +00:00
CommentFormatter: Fix regexp in topic subscription postprocessing
The regexps needs to be non-greedy, otherwise it could swallow up a large chunk of the page (up to the next comment). I noticed this when adding tests for this code, in the 'unclosed-font' test case (Ief9648b8805fadcc170c54b627eb669cc8b907b6). Change-Id: I5f67a9599b0cb07bdd53abeebac9ada221181b66
This commit is contained in:
parent
228b81fab9
commit
0b82162149
|
@ -214,7 +214,7 @@ class CommentFormatter {
|
|||
) : string {
|
||||
$doc = new DOMDocument();
|
||||
$text = preg_replace_callback(
|
||||
'/<!--__DTSUBSCRIBE__(.*)-->/',
|
||||
'/<!--__DTSUBSCRIBE__(.*?)-->/',
|
||||
function ( $matches ) use ( $doc, $subscriptionStore, $user ) {
|
||||
$itemName = $matches[1];
|
||||
$items = $subscriptionStore->getSubscriptionItemsForUser(
|
||||
|
|
Loading…
Reference in a new issue