* (bug 27479) API error when using both prop=pageprops and prop=info&inprop=displaytitle
[lhc/web/wiklou.git] / includes / api / ApiUndelete.php
index d081d0d..a027b7f 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 /**
- * API for MediaWiki 1.8+
+ *
  *
  * Created on Jul 3, 2007
  *
- * Copyright © 2007 Roan Kattouw <Firstname>.<Lastname>@home.nl
+ * Copyright © 2007 Roan Kattouw <Firstname>.<Lastname>@gmail.com
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -42,8 +42,6 @@ class ApiUndelete extends ApiBase {
                global $wgUser;
                $params = $this->extractRequestParams();
 
-               $titleObj = null;
-
                if ( !$wgUser->isAllowed( 'undelete' ) ) {
                        $this->dieUsageMsg( array( 'permdenied-undelete' ) );
                }
@@ -69,8 +67,6 @@ class ApiUndelete extends ApiBase {
                }
 
                $pa = new PageArchive( $titleObj );
-               $dbw = wfGetDB( DB_MASTER );
-               $dbw->begin();
                $retval = $pa->undelete( ( isset( $params['timestamps'] ) ? $params['timestamps'] : array() ), $params['reason'] );
                if ( !is_array( $retval ) ) {
                        $this->dieUsageMsg( array( 'cannotundelete' ) );
@@ -147,6 +143,10 @@ class ApiUndelete extends ApiBase {
                ) );
        }
 
+       public function needsToken() {
+               return true;
+       }
+
        public function getTokenSalt() {
                return '';
        }