Merge "Remove putrid remains of $wgAllowAsyncCopyUploads"
[lhc/web/wiklou.git] / includes / api / ApiEditPage.php
index 90d976a..59264e8 100644 (file)
@@ -100,7 +100,10 @@ class ApiEditPage extends ApiBase {
 
                $name = $titleObj->getPrefixedDBkey();
                $model = $contentHandler->getModelID();
-               if ( $contentHandler->supportsDirectApiEditing() === false ) {
+
+               if ( $params['undo'] > 0 ) {
+                       // allow undo via api
+               } elseif ( $contentHandler->supportsDirectApiEditing() === false ) {
                        $this->dieUsage(
                                "Direct editing via API is not supported for content model $model used by $name",
                                'no-direct-editing'
@@ -244,12 +247,12 @@ class ApiEditPage extends ApiBase {
                                $this->dieUsageMsg( array( 'nosuchrevid', $params['undoafter'] ) );
                        }
 
-                       if ( $undoRev->getPage() != $pageObj->getID() ) {
-                               $this->dieUsageMsg( array( 'revwrongpage', $undoRev->getID(),
+                       if ( $undoRev->getPage() != $pageObj->getId() ) {
+                               $this->dieUsageMsg( array( 'revwrongpage', $undoRev->getId(),
                                        $titleObj->getPrefixedText() ) );
                        }
-                       if ( $undoafterRev->getPage() != $pageObj->getID() ) {
-                               $this->dieUsageMsg( array( 'revwrongpage', $undoafterRev->getID(),
+                       if ( $undoafterRev->getPage() != $pageObj->getId() ) {
+                               $this->dieUsageMsg( array( 'revwrongpage', $undoafterRev->getId(),
                                        $titleObj->getPrefixedText() ) );
                        }
 
@@ -268,7 +271,7 @@ class ApiEditPage extends ApiBase {
                        // If no summary was given and we only undid one rev,
                        // use an autosummary
                        if ( is_null( $params['summary'] ) &&
-                               $titleObj->getNextRevisionID( $undoafterRev->getID() ) == $params['undo']
+                               $titleObj->getNextRevisionID( $undoafterRev->getId() ) == $params['undo']
                        ) {
                                $params['summary'] = wfMessage( 'undo-summary' )
                                        ->params( $params['undo'], $undoRev->getUserText() )->inContentLanguage()->text();