Replace wfRunHooks calls with direct Hooks::run calls
[lhc/web/wiklou.git] / includes / specials / SpecialMovepage.php
index ec9593f..2a7e435 100644 (file)
@@ -549,10 +549,22 @@ class MovePageForm extends UnlistedSpecialPage {
                }
 
                # Do the actual move.
-               $error = $ot->moveTo( $nt, true, $this->reason, $createRedirect );
-               if ( $error !== true ) {
-                       $this->showForm( $error );
+               $mp = new MovePage( $ot, $nt );
+               $valid = $mp->isValidMove();
+               if ( !$valid->isOK() ) {
+                       $this->showForm( $valid->getErrorsArray() );
+                       return;
+               }
+
+               $permStatus = $mp->checkPermissions( $user, $this->reason );
+               if ( !$permStatus->isOK() ) {
+                       $this->showForm( $permStatus->getErrorsArray() );
+                       return;
+               }
 
+               $status = $mp->move( $user, $this->reason, $createRedirect );
+               if ( !$status->isOK() ) {
+                       $this->showForm( $status->getErrorsArray() );
                        return;
                }
 
@@ -592,7 +604,7 @@ class MovePageForm extends UnlistedSpecialPage {
                        $newLink )->params( $oldText, $newText )->parseAsBlock() );
                $out->addWikiMsg( $msgName );
 
-               wfRunHooks( 'SpecialMovepageAfterMove', array( &$this, &$ot, &$nt ) );
+               Hooks::run( 'SpecialMovepageAfterMove', array( &$this, &$ot, &$nt ) );
 
                # Now we move extra pages we've been asked to move: subpages and talk
                # pages.  First, if the old page or the new page is a talk page, we