X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FCommentStoreComment.php;h=9f1681dff08a9c15d118116f928c3ddbff733798;hb=e900893531e76fb8f80c1c9b5be459fd02862c3c;hp=3920ba083febb5e4fb788c681f00a3c65a17cd14;hpb=7320a9577e882fbeacb1772977fbfecf8aa5424d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/CommentStoreComment.php b/includes/CommentStoreComment.php index 3920ba083f..9f1681dff0 100644 --- a/includes/CommentStoreComment.php +++ b/includes/CommentStoreComment.php @@ -19,8 +19,7 @@ * * @file */ - -use Wikimedia\Rdbms\IDatabase; +use MediaWiki\MediaWikiServices; /** * CommentStoreComment represents a comment stored by CommentStore. The fields @@ -51,7 +50,7 @@ class CommentStoreComment { public function __construct( $id, $text, Message $message = null, array $data = null ) { $this->id = $id; $this->text = $text; - $this->message = $message ?: new RawMessage( '$1', [ $text ] ); + $this->message = $message ?: new RawMessage( '$1', [ Message::plaintextParam( $text ) ] ); $this->data = $data; } @@ -65,8 +64,6 @@ class CommentStoreComment { * @return CommentStoreComment */ public static function newUnsavedComment( $comment, array $data = null ) { - global $wgContLang; - if ( $comment instanceof CommentStoreComment ) { return $comment; } @@ -81,7 +78,8 @@ class CommentStoreComment { if ( $comment instanceof Message ) { $message = clone $comment; - $text = $message->inLanguage( $wgContLang ) // Avoid $wgForceUIMsgAsContentMsg + // Avoid $wgForceUIMsgAsContentMsg + $text = $message->inLanguage( MediaWikiServices::getInstance()->getContentLanguage() ) ->setInterfaceMessageFlag( true ) ->text(); return new CommentStoreComment( null, $text, $message, $data );