Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
redirect
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
redirect
Commits
67f6f77c
Commit
67f6f77c
authored
5 years ago
by
Gabriel Carleton-Barnes
Committed by
Sascha Grossenbacher
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Form/RedirectForm.php
+4
-0
4 additions, 0 deletions
src/Form/RedirectForm.php
with
4 additions
and
0 deletions
src/Form/RedirectForm.php
+
4
−
0
View file @
67f6f77c
...
...
@@ -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>'
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment