- if ( strlen( $nt->getDBkey() ) < 1 ) {
- $errors[] = array( 'articleexists' );
- }
- if (
- ( $this->getDBkey() == '' ) ||
- ( !$oldid ) ||
- ( $nt->getDBkey() == '' )
- ) {
- $errors[] = array( 'badarticleerror' );
- }
-
- // Content model checks
- if ( !$wgContentHandlerUseDB &&
- $this->getContentModel() !== $nt->getContentModel() ) {
- // can't move a page if that would change the page's content model
- $errors[] = array(
- 'bad-target-model',
- ContentHandler::getLocalizedName( $this->getContentModel() ),
- ContentHandler::getLocalizedName( $nt->getContentModel() )
- );
- }
-
- // Image-specific checks
- if ( $this->getNamespace() == NS_FILE ) {
- $errors = array_merge( $errors, $this->validateFileMoveOperation( $nt ) );
- }
-
- if ( $nt->getNamespace() == NS_FILE && $this->getNamespace() != NS_FILE ) {
- $errors[] = array( 'nonfile-cannot-move-to-file' );
- }
-
- if ( $auth ) {
- $errors = wfMergeErrorArrays( $errors,
- $this->getUserPermissionsErrors( 'move', $wgUser ),
- $this->getUserPermissionsErrors( 'edit', $wgUser ),
- $nt->getUserPermissionsErrors( 'move-target', $wgUser ),
- $nt->getUserPermissionsErrors( 'edit', $wgUser ) );
- }
-
- $match = EditPage::matchSummarySpamRegex( $reason );
- if ( $match !== false ) {
- // This is kind of lame, won't display nice
- $errors[] = array( 'spamprotectiontext' );
- }
-
- $err = null;
- if ( !wfRunHooks( 'AbortMove', array( $this, $nt, $wgUser, &$err, $reason ) ) ) {
- $errors[] = array( 'hookaborted', $err );
- }
-
- # The move is allowed only if (1) the target doesn't exist, or
- # (2) the target is a redirect to the source, and has no history
- # (so we can undo bad moves right after they're done).