Merge "Remove __DTLATESTCOMMENTPAGE__ comment from output"

This commit is contained in:
jenkins-bot 2023-02-02 17:52:23 +00:00 committed by Gerrit Code Review
commit b95faa7978

View file

@ -737,15 +737,17 @@ class CommentFormatter {
/**
* Post-process visual enhancements features for page subtitle
*
* @param string $text
* @param string &$text
* @param Language $lang
* @param UserIdentity $user
* @return ?string
*/
public static function postprocessVisualEnhancementsSubtitle(
string $text, Language $lang, UserIdentity $user
string &$text, Language $lang, UserIdentity $user
): ?string {
preg_match( '/<!--__DTLATESTCOMMENTPAGE__(.*?)__-->/', $text, $matches );
// The subtitle is inserted into the correct place by the caller, so cleanup the comment here
$text = preg_replace( '/<!--__DTLATESTCOMMENTPAGE__(.*?)-->/', '', $text );
if ( count( $matches ) ) {
$itemData = json_decode( htmlspecialchars_decode( $matches[1] ), true );