Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Make it possible to validate host, source and target path #100

Open
wants to merge 3 commits into
base: 2.0
Choose a base branch
from

Conversation

markusguenther
Copy link
Member

@markusguenther markusguenther commented Oct 9, 2024

At the moment, we can validate only the source path with a regex in the configuration. This change extends the function to be able to also validate the host and target path.

Neos:
  RedirectHandler:
    validation:
      sourceUriPath: '/^[a-z0-9_\-\/\.%]+$/i'
      targetUriPath: 'test-regex'
      host: 'another-regex'

Additionally, the PR adds the targetUriPath pattern for the form validation.
As the Javascript side needs another format of regular expressions, we need to configure it at another path.

Neos:
  RedirectHandler:
    Ui:
      validation:
         targetUriPath: 'test-regex'

@markusguenther markusguenther changed the base branch from main to 2.0 October 9, 2024 10:26
At the moment we can validate only the source path with a regex in the configuration. This change extends the function to be able to also validate the host and target path.
@markusguenther markusguenther force-pushed the feature/use-multiple-validation-options branch from 0e126c2 to bec3032 Compare October 9, 2024 10:29
Resources/Private/Translations/de/Modules.xlf Outdated Show resolved Hide resolved
}

if (!$valid) {
$this->addFlashMessage('', implode('<br>', $errorMessages), Message::SEVERITY_WARNING);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to show all errors and not just the first one.
Will test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants