+ $from = $request->getVal( 'from' );
+ $rev = $this->page->getRevision();
+ if ( $from === null ) {
+ throw new ErrorPageError( 'rollbackfailed', 'rollback-missingparam' );
+ }
+ if ( !$rev ) {
+ throw new ErrorPageError( 'rollbackfailed', 'rollback-missingrevision' );
+ }
+ if ( $from !== $rev->getUserText() ) {
+ throw new ErrorPageError( 'rollbackfailed', 'alreadyrolled', [
+ $this->getTitle()->getPrefixedText(),
+ $from,
+ $rev->getUserText()
+ ] );
+ }