Clean up ApiEditPage content handler undo logic
[lhc/web/wiklou.git] / includes / api / ApiEditPage.php
index 3f63a00..554df61 100644 (file)
@@ -92,9 +92,8 @@ class ApiEditPage extends ApiBase {
                $name = $titleObj->getPrefixedDBkey();
                $model = $contentHandler->getModelID();
 
-               if ( $params['undo'] > 0 ) {
-                       // allow undo via api
-               } elseif ( $contentHandler->supportsDirectApiEditing() === false ) {
+               // always allow undo via api, T230702
+               if ( !( $params['undo'] > 0 ) && $contentHandler->supportsDirectApiEditing() === false ) {
                        $this->dieWithError( [ 'apierror-no-direct-editing', $model, $name ] );
                }