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

Update regexp for messageCategory validation #513

Merged
merged 3 commits into from
Jan 29, 2023
Merged

Conversation

rob006
Copy link
Contributor

@rob006 rob006 commented Jan 29, 2023

Appendix for #511. While it fixed original intentions from #456, it seem to be too restrictive. Even documentation proposes categories like app/error, so it does not make sense to disallow / character. In addition to that . and - could be also useful for message categories.

@what-the-diff
Copy link

what-the-diff bot commented Jan 29, 2023

  • The error message for the validation of a blank message category was changed from "Message Category cannot be blank." to 'Message Category cannot be blank.'.
  • The regular expression used in validating the format of a non-blank message category was updated to allow dots, dashes and slashes as well as alphanumeric characters and underscores (the original regex only allowed alphanumeric characters and underscores).
  • A new error message is displayed when an invalid character is found in the inputted value: "Message Category is not valid..." instead of "...is not valid". This change also includes more information about what constitutes a correct value by listing all acceptable values rather than just stating that it should contain only certain types of characters without specifying which ones are accepted or rejected.

@rob006 rob006 marked this pull request as ready for review January 29, 2023 12:50
@bizley bizley added the type:enhancement Enhancement label Jan 29, 2023
@bizley bizley added this to the 2.2.6 milestone Jan 29, 2023
@bizley bizley merged commit 59d16e6 into yiisoft:master Jan 29, 2023
@bizley
Copy link
Member

bizley commented Jan 29, 2023

👍🏻

@rob006 rob006 deleted the patch-1 branch January 29, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants