function execute() { global $wgRequest, $wgOut, $wgUser; if (!$wgUser->matchEditToken($wgRequest->getVal('wpEditToken'))) { $wgOut->addHTML('<strong>' . wfMsg('sessionfailure') . '</strong>'); parent::execute(); return; } if (!$this->mRev) { parent::execute(); return; } $commentId = $this->revisionUpdate($this->mStatus, $this->mAddTags, $this->mRemoveTags, $this->mSignoffFlags, $this->mStrikeSignoffs, $this->mAddReferences, $this->mRemoveReferences, $this->text, $wgRequest->getIntOrNull('wpParent'), $wgRequest->getInt('wpReview'), $this->mAddReferenced, $this->mRemoveReferenced); $redirTarget = null; // For comments, take us back to the rev page focused on the new comment if ($commentId !== 0 && !$this->jumpToNext) { $redirTarget = $this->commentLink($commentId); } // Return to rev page if (!$redirTarget) { // Was "next" (or "save & next") clicked? if ($this->jumpToNext) { $next = $this->mRev->getNextUnresolved($this->mPath); if ($next) { $redirTarget = SpecialPage::getTitleFor('Code', $this->mRepo->getName() . '/' . $next); } else { $redirTarget = SpecialPage::getTitleFor('Code', $this->mRepo->getName()); } } else { # $redirTarget already set for comments $redirTarget = $this->revLink(); } } $wgOut->redirect($redirTarget->getFullUrl(array('path' => $this->mPath))); }