Merge "Make Special:ChangeContentModel field labels consistently use colons"
[lhc/web/wiklou.git] / includes / api / ApiEditPage.php
index 554df61..3f63a00 100644 (file)
@@ -92,8 +92,9 @@ class ApiEditPage extends ApiBase {
                $name = $titleObj->getPrefixedDBkey();
                $model = $contentHandler->getModelID();
 
-               // always allow undo via api, T230702
-               if ( !( $params['undo'] > 0 ) && $contentHandler->supportsDirectApiEditing() === false ) {
+               if ( $params['undo'] > 0 ) {
+                       // allow undo via api
+               } elseif ( $contentHandler->supportsDirectApiEditing() === false ) {
                        $this->dieWithError( [ 'apierror-no-direct-editing', $model, $name ] );
                }