Skip to content

Commit

Permalink
Get displayTitle if set with %TITLE%
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Feb 9, 2025
1 parent 4cf213a commit 998b2e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/Lister/Lister.php
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ protected function replaceTagParameters( $tag, Article $article ) {
$tag = str_replace( '%EDITSUMMARY%', $article->mComment, $tag );

$title = $article->mTitle->getText();
$displayTitle = $this->parser->getOutput()->getPageProperty( 'displaytitle' );
$replaceInTitle = $this->getParameters()->getParameter( 'replaceintitle' );

if ( is_array( $replaceInTitle ) && count( $replaceInTitle ) === 2 ) {
Expand All @@ -801,7 +802,7 @@ protected function replaceTagParameters( $tag, Article $article ) {
$title = substr( $title, 0, $titleMaxLength ) . '...';
}

$tag = str_replace( '%TITLE%', $title, $tag );
$tag = str_replace( '%TITLE%', $displayTitle ?? $title, $tag );

$tag = str_replace( '%COUNT%', (string)$article->mCounter, $tag );
$tag = str_replace( '%COUNTFS%', (string)( floor( log( $article->mCounter ) * 0.7 ) ), $tag );
Expand Down

0 comments on commit 998b2e0

Please sign in to comment.