/** * @param EntityRedirect $redirect * @param Summary $summary * @param bool $bot Whether the edit should be marked as bot * * @throws RedirectCreationException */ private function saveRedirect(EntityRedirect $redirect, Summary $summary, $bot) { $summary = $this->summaryFormatter->formatSummary($summary); $flags = EDIT_UPDATE; if ($bot) { $flags = $flags | EDIT_FORCE_BOT; } $hookStatus = $this->editFilterHookRunner->run($redirect, $this->user, $summary); if (!$hookStatus->isOK()) { throw new RedirectCreationException('EditFilterHook stopped redirect creation', 'cant-redirect'); } try { $this->entityStore->saveRedirect($redirect, $summary, $this->user, $flags); } catch (StorageException $ex) { throw new RedirectCreationException($ex->getMessage(), 'cant-redirect', $ex); } }