dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Force user id and actor id to 0 when loading from remote wikis"
[lhc/web/wiklou.git]
/
includes
/
CommentStoreComment.php
diff --git
a/includes/CommentStoreComment.php
b/includes/CommentStoreComment.php
index
7ed86d6
..
9f1681d
100644
(file)
--- a/
includes/CommentStoreComment.php
+++ b/
includes/CommentStoreComment.php
@@
-19,6
+19,7
@@
*
* @file
*/
*
* @file
*/
+use MediaWiki\MediaWikiServices;
/**
* CommentStoreComment represents a comment stored by CommentStore. The fields
/**
* CommentStoreComment represents a comment stored by CommentStore. The fields
@@
-49,7
+50,7
@@
class CommentStoreComment {
public function __construct( $id, $text, Message $message = null, array $data = null ) {
$this->id = $id;
$this->text = $text;
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;
}
$this->data = $data;
}
@@
-63,8
+64,6
@@
class CommentStoreComment {
* @return CommentStoreComment
*/
public static function newUnsavedComment( $comment, array $data = null ) {
* @return CommentStoreComment
*/
public static function newUnsavedComment( $comment, array $data = null ) {
- global $wgContLang;
-
if ( $comment instanceof CommentStoreComment ) {
return $comment;
}
if ( $comment instanceof CommentStoreComment ) {
return $comment;
}
@@
-79,7
+78,8
@@
class CommentStoreComment {
if ( $comment instanceof Message ) {
$message = clone $comment;
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 );
->setInterfaceMessageFlag( true )
->text();
return new CommentStoreComment( null, $text, $message, $data );