- global $wgContLang;
-
- if ( !$comment instanceof CommentStoreComment ) {
- if ( $data !== null ) {
- foreach ( $data as $k => $v ) {
- if ( substr( $k, 0, 1 ) === '_' ) {
- throw new InvalidArgumentException( 'Keys in $data beginning with "_" are reserved' );
- }
- }
- }
- if ( $comment instanceof Message ) {
- $message = clone $comment;
- $text = $message->inLanguage( $wgContLang ) // Avoid $wgForceUIMsgAsContentMsg
- ->setInterfaceMessageFlag( true )
- ->text();
- $comment = new CommentStoreComment( null, $text, $message, $data );
- } else {
- $comment = new CommentStoreComment( null, $comment, null, $data );
- }
- }