From 7d9c1f3f3096f72033adc18c8250415e3d89dfad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gu=CC=88nther?= Date: Thu, 26 Sep 2024 15:35:14 +0200 Subject: [PATCH] BUGFIX: Trim leading and tailing whitespaces 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 --- packages/neos-ui-editors/src/Library/LinkInput.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/neos-ui-editors/src/Library/LinkInput.js b/packages/neos-ui-editors/src/Library/LinkInput.js index af590598d6..abad8084cc 100644 --- a/packages/neos-ui-editors/src/Library/LinkInput.js +++ b/packages/neos-ui-editors/src/Library/LinkInput.js @@ -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)) {