Skip to content

defaultValidators.js node regex matches everything #308

@avinxshKD

Description

@avinxshKD

var regex = /^[A-za-z0-9]+[:[A-Za-z0-9.]+]|[^$]$/;

this has three issues:

  1. A-z includes []^_` (should be A-Z)
  2. [:[A-Za-z0-9.]+] is a character class not a group
  3. |[^$]$ matches any string ending in non-$ char, so basically everything

Creating a node with label !!! or <script>, passes fine

Should probably be /^[A-Za-z0-9]+(:[A-Za-z0-9.]+)?$/ but honestly depends on what the actual label format is supposed to be. Current regex validates nothin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions