Skip to content

Commit

Permalink
Added extra check not to try to redirect to empty referrer url
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnar Eivind Martinsen committed Dec 14, 2023
1 parent bb1fb95 commit 82b56af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@
"json.schemas": [],
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.eslint": "explicit"
}
}
10 changes: 8 additions & 2 deletions metsis/metsis_csv_bokeh/src/Form/MetsisCsvBokehDownloadForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,14 @@ public function adcGetCsvBokehPlotVars($data_uri, FormStateInterface $form_state

// $response = new RedirectResponse($form_state->get('referer'));
// $response->send();
$url = Url::fromUri($form_state->get('referer'));
$form_state->setRedirectUrl($url);
if (NULL !== $form_state->get('referer')) {
$url = Url::fromUri($form_state->get('referer'));
$form_state->setRedirectUrl($url);
}
else {
$url = Url::fromUri('/metsis/search');
$form_state->setRedirectUrl($url);
}

// $form_state->setRedirect($form_state->get('referer'));
return NULL;
Expand Down

0 comments on commit 82b56af

Please sign in to comment.