Skip to content

Commit

Permalink
BUGFIX: Trim leading and tailing whitespaces
Browse files Browse the repository at this point in the history
Whitespaces like a tab can lead to a 404 error if a URL has been pasted to a LinkEditor or LinkInput.

As datasources, assets, URLs and slugs should not start with a whitespace, we can remove them.

Fixes: #3859
  • Loading branch information
markusguenther committed Sep 26, 2024
1 parent 537b1a2 commit 7d9c1f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/neos-ui-editors/src/Library/LinkInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export default class LinkInput extends PureComponent {
}

handleSearchTermChange = searchTerm => {
// trim leading and trailing whitespace as it can cause issues
// with the further processing
searchTerm.trim()

this.setState({searchTerm});

if (isUriOrInternalLink(searchTerm)) {
Expand Down

0 comments on commit 7d9c1f3

Please sign in to comment.