* Determines if $user is unable to edit this page because it has been protected
* by $wgNamespaceProtection.
*
+ * @deprecated since 1.34 Don't use this function in new code.
* @param User $user User object to check permissions
* @return bool
*/
public static function capitalize( $text, $ns = NS_MAIN ) {
$services = MediaWikiServices::getInstance();
if ( $services->getNamespaceInfo()->isCapitalized( $ns ) ) {
- return MediaWikiServices::getInstance()->getContentLanguage()->ucfirst( $text );
+ return $services->getContentLanguage()->ucfirst( $text );
} else {
return $text;
}
return [ [ 'badtitletext' ] ];
}
- $mp = new MovePage( $this, $nt );
+ $mp = MediaWikiServices::getInstance()->getMovePageFactory()->newMovePage( $this, $nt );
$errors = $mp->isValidMove()->getErrorsArray();
if ( $auth ) {
$errors = wfMergeErrorArrays(
global $wgUser;
- $mp = new MovePage( $this, $nt );
+ $mp = MediaWikiServices::getInstance()->getMovePageFactory()->newMovePage( $this, $nt );
$method = $auth ? 'moveIfAllowed' : 'move';
$status = $mp->$method( $wgUser, $reason, $createRedirect, $changeTags );
if ( $status->isOK() ) {