Skip to content

Streamlining Regex Validation in Neos Redirect Handler UI #101

@markusguenther

Description

@markusguenther

Neos currently uses separate regular expressions for validating source and target URIs in the Redirect Handler UI. These validations exist in two distinct configurations: Neos:RedirectHandler:validation and Neos:RedirectHandler:Ui:validation. This redundancy leads to:

  • Increased maintenance overhead: Maintaining consistent regex patterns across two locations is time-consuming and prone to errors.
  • Potential inconsistencies: Mismatches between the PHP and JavaScript validations can cause unexpected behavior.

We propose a centralized validation approach to simplify the process and improve consistency. This involves:

  • Server-side validation: Implement a new endpoint that accepts source and target URIs as parameters.
  • Unified regex engine: This endpoint will utilize a single, unified set of regex patterns for validation on the server-side.
  • Client-side validation integration: Refactor the JavaScript code of the Redirect Handler UI to leverage the new server-side validation endpoint. Upon user input, an asynchronous request will be sent to the server for validation.

https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions