#5145: Cake should have a alphanumeric+whitespace validation rule ----------------------------+----------------------------------------------- Reporter: mryellow | Owner: Type: Enhancement | Status: reopened Priority: Low | Milestone: 1.2.x.x Component: Validation | Version: RC3 Severity: Normal | Resolution: Keywords: | Php_version: n/a Cake_version: | ----------------------------+----------------------------------------------- Comment (by michaelc):
Replying to [comment:8 phally]: > Replying to [comment:7 michaelc]: > > Please change milestone to 1.3.x.x - a more generic and useful extension is to allow special characters to be passed to the alphaNumeric function as an optional second parameter, such as Sanitize::paranoid accepts. I create my own versions of the same to slap into AppModel until the framework supports the common case. [[BR]] > I can't think of many good examples when to use this and why a simple regex wouldn't do fine. When you start adding characters to the alphanumeric rule, it wouldn't be very alphanumeric right? [[BR]] Mostly because I wouldn't like typing {{{'/^[\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd} ]+$/mu'}}} once for every different rule I'll be using, with the exception of a character or two. I'm currently using these rules for address and name, as a shorthand for a fairly bothersome regex. [[BR]] Though I admit that we don't always want to lock down a system entirely, occasionally CakePHP's email validation regex, {{{'/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9][-a-z0-9]*\.)*(?:[a-z0-9][-a-z0-9]{0,62})\.(?:(?:[a-z]{2}\.)?[a-z]{2,4}|museum|travel)$/i'}}}, can be nice to have. -- Ticket URL: <https://trac.cakephp.org/ticket/5145#comment:9> CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/> Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tickets cakephp" group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~----------~----~----~----~------~----~------~--~---