Skip to content

Commit

Permalink
Merge pull request #579 from joomlatools/feature/578-redirect
Browse files Browse the repository at this point in the history
Form redirect to external url
  • Loading branch information
johanjanssens authored Mar 10, 2021
2 parents acb353d + b39afa9 commit 6dfe0a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions code/site/components/com_pages/controller/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ protected function _actionSubmit(KControllerContextInterface $context)
{
if($redirect = $this->getPage()->form->redirect)
{
$url = $this->getView()->getRoute($redirect);
$this->getResponse()->setRedirect($url);
if(substr($redirect, 0, 4) !== 'http') {
$redirect = $this->getView()->getRoute($redirect);
}

$this->getResponse()->setRedirect($redirect);
}
else $context->response->setStatus(KHttpResponse::RESET_CONTENT);
}
Expand Down

0 comments on commit 6dfe0a6

Please sign in to comment.