Skip to content

[Bug] Fix ID validation to take into account multiple values and UUID formatΒ #71

@alexjustesen

Description

@alexjustesen

πŸ“ƒ Description

Fix by_ids validation to take into account multiple values and that each should be a valid UUID v4 format.

βœ… To-dos

πŸ“ Proposed rule

$uuids = array_map('trim', explode(',', $value));

foreach ($uuids as $uuid) {
    if (! preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', $uuid)) {
        $fail("The {$attribute} contains invalid UUID: {$uuid}");
    }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions