title: Validating customer names, address and phone
body: <p>So far I have been quite impressed by out of the box features provided by Prestashop but this thing really let me down: If someone wants to register on the site or do a guest check out he can put anything as his name. Anything includes things like "---", all spaces, "<em>*</em>" etc. There is no validation provided here and this is really annoying. </p>
  
  <p>I have tried to modify the processSubmitAccount method in website\controllers\front\AuthController.php to use the Validate::isName() method but this does not help at all. It lets the users put all the strange character in the name field. I tried to create another method inside the Validate class:</p>
  
  <pre><code>public static function isHumanName($name)
  {    
   return preg_match('/^[A-Za-z]+$/', $name);
  }
  </code></pre>
  
  <p>but for some reason this simple pattern does not work. All I want to be able to do is allow names like "FirstName MiddleName" having only one space chracter at a time and not at the start of the name. My php and regex skills are minimal and this is all I have come up with so far. </p>
  
  <p>EDIT: Acceptable names would be:</p>
  
  <ol>
  <li>FirstName</li>
  <li>FirstName Second Third Fourth Fifth</li>
  <li>Names can be case insensitive.</li>
  </ol>
  
  <p>After reading comments, I think I will give up on validating Addresses so striking out below para.</p>
  
  <p><strike>Besides name I want to validate addresses and phone numbers. Addresses can have numbers in addition to letters while phone numbers can only have numbers. I guess if the problem with validating names is solved then I would be able to do it for address and numbers as well. </strike></p>
  
  <p>I would appreciate if someone can put me in right direction.</p>
  
  <p><strong>PS: It is a separate debate whether enforcing a naming policy is right or wrong.</strong>
  *<em>DISCLAIMER: The answer to this question does not mean that readers use the same thing in their production applications for validating names.</em>*</p>