Let's not return arrays of arrays of arrays here :O
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 27 May 2008 16:10:43 +0000 (16:10 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 27 May 2008 16:10:43 +0000 (16:10 +0000)
includes/Title.php

index 9829ee2..c7ea915 100644 (file)
@@ -2400,22 +2400,22 @@ class Title {
                        return array(array('badtitletext'));
                }
                if( $this->equals( $nt ) ) {
-                       $errors[] = array(array('selfmove'));
+                       $errors[] = array('selfmove');
                }
                if( !$this->isMovable() || !$nt->isMovable() ) {
-                       $errors[] = array(array('immobile_namespace'));
+                       $errors[] = array('immobile_namespace');
                }
 
                $oldid = $this->getArticleID();
                $newid = $nt->getArticleID();
 
                if ( strlen( $nt->getDBkey() ) < 1 ) {
-                       $errors[] = array(array('articleexists'));
+                       $errors[] = array('articleexists');
                }
                if ( ( '' == $this->getDBkey() ) ||
                         ( !$oldid ) ||
                     ( '' == $nt->getDBkey() ) ) {
-                       $errors[] = array(array('badarticleerror'));
+                       $errors[] = array('badarticleerror');
                }
 
                // Image-specific checks
@@ -2423,10 +2423,10 @@ class Title {
                        $file = wfLocalFile( $this );
                        if( $file->exists() ) {
                                if( $nt->getNamespace() != NS_IMAGE ) {
-                                       $errors[] = array(array('imagenocrossnamespace'));
+                                       $errors[] = array('imagenocrossnamespace');
                                }
                                if( !File::checkExtensionCompatibility( $file, $nt->getDbKey() ) ) {
-                                       $errors[] = array(array('imagetypemismatch'));
+                                       $errors[] = array('imagetypemismatch');
                                }
                        }
                }
@@ -2443,7 +2443,7 @@ class Title {
                global $wgUser;
                $err = null;
                if( !wfRunHooks( 'AbortMove', array( $this, $nt, $wgUser, &$err ) ) ) {
-                       $errors[] = array(array('hookaborted', $err));
+                       $errors[] = array('hookaborted', $err);
                }
 
                # The move is allowed only if (1) the target doesn't exist, or
@@ -2452,13 +2452,13 @@ class Title {
 
                if ( 0 != $newid ) { # Target exists; check for validity
                        if ( ! $this->isValidMoveTarget( $nt ) ) {
-                               $errors[] = array(array('articleexists'));
+                               $errors[] = array('articleexists');
                        }
                } else {
                        $tp = $nt->getTitleProtection();
                        $right = ( $tp['pt_create_perm'] == 'sysop' ) ? 'protect' : $tp['pt_create_perm'];
                        if ( $tp and !$wgUser->isAllowed( $right ) ) {
-                               $errors[] = array(array('cantmove-titleprotected'));
+                               $errors[] = array('cantmove-titleprotected');
                        }
                }
                if(empty($errors))