X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flogging%2FLogFormatter.php;h=2a47943a0383ab0436a9c18ec7aa4ae5aca2e250;hp=b5af7836ca531fabc1e821f92171c6561544bfa4;hb=d19826aa35b206847a568a4b2c1c9ffaa615fca5;hpb=f4e63f6047131a1dd6f8bd6dfafcfba44b22873d diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index b5af7836ca..2a47943a03 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -22,6 +22,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later * @since 1.19 */ +use MediaWiki\Linker\LinkRenderer; +use MediaWiki\MediaWikiServices; /** * Implements the default log formatting. @@ -101,6 +103,11 @@ class LogFormatter { /** @var string */ protected $irctext = false; + /** + * @var LinkRenderer|null + */ + private $linkRenderer; + protected function __construct( LogEntry $entry ) { $this->entry = $entry; $this->context = RequestContext::getMain(); @@ -114,6 +121,26 @@ class LogFormatter { $this->context = $context; } + /** + * @since 1.30 + * @param LinkRenderer $linkRenderer + */ + public function setLinkRenderer( LinkRenderer $linkRenderer ) { + $this->linkRenderer = $linkRenderer; + } + + /** + * @since 1.30 + * @return LinkRenderer + */ + public function getLinkRenderer() { + if ( $this->linkRenderer !== null ) { + return $this->linkRenderer; + } else { + return MediaWikiServices::getInstance()->getLinkRenderer(); + } + } + /** * Set the visibility restrictions for displaying content. * If set to public, and an item is deleted, then it will be replaced @@ -167,7 +194,7 @@ class LogFormatter { /** * Even uglier hack to maintain backwards compatibilty with IRC bots - * (bug 34508). + * (T36508). * @see getActionText() * @return string Text */ @@ -188,7 +215,7 @@ class LogFormatter { /** * Even uglier hack to maintain backwards compatibilty with IRC bots - * (bug 34508). + * (T36508). * @see getActionText() * @return string Text */