Code Duplication    Length = 3-3 lines in 2 locations

includes/api/ApiEditPage.php 2 locations

@@ 239-241 (lines=3) @@
236
				$undoafterRev = Revision::newFromId( $params['undoafter'] );
237
			}
238
			$undoRev = Revision::newFromId( $params['undo'] );
239
			if ( is_null( $undoRev ) || $undoRev->isDeleted( Revision::DELETED_TEXT ) ) {
240
				$this->dieUsageMsg( [ 'nosuchrevid', $params['undo'] ] );
241
			}
242
243
			if ( $params['undoafter'] == 0 ) {
244
				$undoafterRev = $undoRev->getPrevious();
@@ 246-248 (lines=3) @@
243
			if ( $params['undoafter'] == 0 ) {
244
				$undoafterRev = $undoRev->getPrevious();
245
			}
246
			if ( is_null( $undoafterRev ) || $undoafterRev->isDeleted( Revision::DELETED_TEXT ) ) {
247
				$this->dieUsageMsg( [ 'nosuchrevid', $params['undoafter'] ] );
248
			}
249
250
			if ( $undoRev->getPage() != $pageObj->getId() ) {
251
				$this->dieUsageMsg( [ 'revwrongpage', $undoRev->getId(),