* @return Title the new object
*/
public static function newMainPage() {
- $title = Title::newFromText( wfMsgForContent( 'mainpage' ) );
+ $title = Title::newFromText( wfMessage( 'mainpage' )->inContentLanguage()->text() );
// Don't give fatal errors if the message is broken
if ( !$title ) {
$title = Title::newFromText( 'Main Page' );
* queries by skipping checks for cascading protections and user blocks.
* @param $ignoreErrors Array of Strings Set this to a list of message keys
* whose corresponding errors may be ignored.
- * @return Array of arguments to wfMsg to explain permissions problems.
+ * @return Array of arguments to wfMessage to explain permissions problems.
*/
public function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true, $ignoreErrors = array() ) {
$errors = $this->getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries );
# Check $wgNamespaceProtection for restricted namespaces
if ( $this->isNamespaceProtected( $user ) ) {
$ns = $this->mNamespace == NS_MAIN ?
- wfMsg( 'nstab-main' ) : $this->getNsText();
+ wfMessage( 'nstab-main' )->text() : $this->getNsText();
$errors[] = $this->mNamespace == NS_MEDIAWIKI ?
array( 'protectedinterface' ) : array( 'namespaceprotected', $ns );
}
$id = $user->blockedBy();
$reason = $user->blockedFor();
if ( $reason == '' ) {
- $reason = wfMsg( 'blockednoreason' );
+ $reason = wfMessage( 'blockednoreason' )->text();
}
$ip = $user->getRequest()->getIP();
* @param $user User to check
* @param $doExpensiveQueries Bool Set this to false to avoid doing unnecessary queries.
* @param $short Bool Set this to true to stop after the first permission error.
- * @return Array of arrays of the arguments to wfMsg to explain permissions problems.
+ * @return Array of arrays of the arguments to wfMessage to explain permissions problems.
*/
protected function getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries = true, $short = false ) {
wfProfileIn( __METHOD__ );
);
# Update the protection log
$log = new LogPage( 'protect' );
- $comment = wfMsgForContent( 'prot_1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
+ $comment = wfMessage(
+ 'prot_1movedto2',
+ $this->getPrefixedText(),
+ $nt->getPrefixedText()
+ )->inContentLanguage()->text();
if ( $reason ) {
- $comment .= wfMsgForContent( 'colon-separator' ) . $reason;
+ $comment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $reason;
}
// @todo FIXME: $params?
$log->addEntry( 'move_prot', $nt, $comment, array( $this->getPrefixedText() ) );
$formatter->setContext( RequestContext::newExtraneousContext( $this ) );
$comment = $formatter->getPlainActionText();
if ( $reason ) {
- $comment .= wfMsgForContent( 'colon-separator' ) . $reason;
+ $comment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $reason;
}
# Truncate for whole multibyte characters.
$comment = $wgContLang->truncate( $comment, 255 );
return false;
}
# Get the article text
- $rev = Revision::newFromTitle( $nt );
+ $rev = Revision::newFromTitle( $nt, false, Revision::READ_LATEST );
if( !is_object( $rev ) ){
return false;
}