$title = Title::newFromTextThrow( $value );
} else {
// Can't use Title::makeTitleSafe(), because it doesn't throw useful exceptions
- global $wgContLang;
- $namespaceName = $wgContLang->getNsText( $this->mParams['namespace'] );
- $title = Title::newFromTextThrow( $namespaceName . ':' . $value );
+ $title = Title::newFromTextThrow( Title::makeName( $this->mParams['namespace'], $value ) );
}
} catch ( MalformedTitleException $e ) {
- $msg = $this->msg( $e->getErrorMessage() );
- $params = $e->getErrorMessageParameters();
- if ( $params ) {
- $msg->params( $params );
- }
- return $msg;
+ return $this->msg( $e->getErrorMessage(), $e->getErrorMessageParameters() );
}
$text = $title->getPrefixedText();
if ( $this->mParams['namespace'] !== false &&
!$title->inNamespace( $this->mParams['namespace'] )
) {
- return $this->msg( 'htmlform-title-badnamespace', $this->mParams['namespace'], $text );
+ return $this->msg( 'htmlform-title-badnamespace', $text, $this->mParams['namespace'] );
}
if ( $this->mParams['creatable'] && !$title->canExist() ) {