You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validation of email addresses from forms (i.e. EmailField)
validation of email addresses elsewhere (or else use egulias/email-validator validation for everything email related)
password strength validation (which checks entropy instead of arbitrary rules)
file and image validation (we probably do a lot of custom checks that this can do with less code on our end)
locale and language codes (I don't think we currently check those for i18n stuff, but we should)
Because this would represent a change in logic, it could break some things so it needs to either be opt-in where it's applied or just be done in a major release.
Acceptance criteria
Compile a list of things where existing logic could be replaced e.g. long regexs (ended up just using the list of constraints as my list of things to check)
Use symfony constraints for the easy stuff
[ ] Raise new cards for anything that is harder no need
For password strength validation (and possibly others, though probably not) - it's still possible to implement their own business logic i.e. disable symfony constraints
Validation applied:
URLs
Email addresses
Ip addresses
Passwords
File and image validation would require changing too much code surrounding the validation itself, and locale stuff didn't seem worthwhile.
Most other validation was for things like "not blank" which is trivial to do without relying on symfony (or in the case of RequiredFields our setup is currently too idiosyncratic to rely on something that simple)
In silverstripe/silverstripe-framework#11123 we added a lightweight wrapper around
symfony/validator
, which has a ton of validation constraints we can use all over the place if we want to.Some obvious quick wins:
EmailField
)egulias/email-validator
validation for everything email related)Because this would represent a change in logic, it could break some things so it needs to either be opt-in where it's applied or just be done in a major release.
Acceptance criteria
[ ] Raise new cards for anything that is harderno needValidation applied:
File and image validation would require changing too much code surrounding the validation itself, and locale stuff didn't seem worthwhile.
Most other validation was for things like "not blank" which is trivial to do without relying on symfony (or in the case of
RequiredFields
our setup is currently too idiosyncratic to rely on something that simple)CMS 5 PRs
CMS 6 PRs
The text was updated successfully, but these errors were encountered: