Merge "Ensure database is setup in MediaWikiTestCase::insertPage"
[lhc/web/wiklou.git] / includes / CommentStoreComment.php
index 7ed86d6..af866cd 100644 (file)
@@ -19,6 +19,7 @@
  *
  * @file
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * CommentStoreComment represents a comment stored by CommentStore. The fields
@@ -63,8 +64,6 @@ class CommentStoreComment {
         * @return CommentStoreComment
         */
        public static function newUnsavedComment( $comment, array $data = null ) {
-               global $wgContLang;
-
                if ( $comment instanceof CommentStoreComment ) {
                        return $comment;
                }
@@ -79,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 );