Skip to content
Snippets Groups Projects
Commit 67f6f77c authored by Gabriel Carleton-Barnes's avatar Gabriel Carleton-Barnes Committed by Sascha Grossenbacher
Browse files

Issue #3032976 by miteshmap, gcb: Remove trailing spaces from source url

parent c68448be
No related branches found
No related tags found
No related merge requests found
......@@ -93,6 +93,10 @@ class RedirectForm extends ContentEntityForm {
public function validateForm(array &$form, FormStateInterface $form_state) {
parent::validateForm($form, $form_state);
$source = $form_state->getValue(['redirect_source', 0]);
// Trim any trailing spaces from source url, leaving leading space as is.
// leading space is still a valid candidate to add for 301 source url.
$source['path'] = rtrim($source['path']);
$form_state->setValue('redirect_source', [$source]);
$redirect = $form_state->getValue(['redirect_redirect', 0]);
if ($source['path'] == '<front>') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment