Following r100264, update usages in core
[lhc/web/wiklou.git] / includes / specials / SpecialMovepage.php
index 540d7be..e3003da 100644 (file)
@@ -42,10 +42,7 @@ class MovePageForm extends UnlistedSpecialPage {
        }
 
        public function execute( $par ) {
-               # Check for database lock
-               if ( wfReadOnly() ) {
-                       throw new ReadOnlyError;
-               }
+               $this->checkReadOnly();
 
                $this->setHeaders();
                $this->outputHeader();
@@ -192,7 +189,7 @@ class MovePageForm extends UnlistedSpecialPage {
                        $out->addWikiMsg( 'movepagetalktext' );
                }
 
-               $token = htmlspecialchars( $user->editToken() );
+               $token = htmlspecialchars( $user->getEditToken() );
 
                if ( !empty($err) ) {
                        $out->addSubtitle( $this->msg( 'formerror' ) );
@@ -376,9 +373,11 @@ class MovePageForm extends UnlistedSpecialPage {
                        $reason = wfMessage( 'delete_and_move_reason', $ot )->inContentLanguage()->text();
 
                        // Delete an associated image if there is
-                       $file = wfLocalFile( $nt );
-                       if( $file->exists() ) {
-                               $file->delete( $reason, false );
+                       if ( $nt->getNamespace() == NS_FILE ) {
+                               $file = wfLocalFile( $nt );
+                               if ( $file->exists() ) {
+                                       $file->delete( $reason, false );
+                               }
                        }
 
                        $error = ''; // passed by ref