protected function checkCanExecute(User $user) { parent::checkCanExecute($user); $oldimage = $this->getRequest()->getText('oldimage'); if (strlen($oldimage) < 16 || strpos($oldimage, '/') !== false || strpos($oldimage, '\\') !== false) { throw new ErrorPageError('internalerror', 'unexpected', array('oldimage', $oldimage)); } $this->oldFile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName($this->getTitle(), $oldimage); if (!$this->oldFile->exists()) { throw new ErrorPageError('', 'filerevert-badversion'); } }