When creating a new address, we can save it into the DB even the phone number is just a whitespace.
To test: BO > Customers > Addresses > Set required fields for this section > make the phone required, FO > Sign in > My addresses > Add a new address > fill the phone number with whitespace and "Save", check if the error message is displayed.
The following almost fixes it, it makes it so you can't just put in a space, but doesn't fix the fact when you put in a space, goto a different field, the phone # field you just put a space in colors green for good. It also doesnt take into factor that I can put in an incomplete phone number, like 123-456-7 or 1234567, in the US it should have 10 digits.(ie. 123-456-7890) I guess I could change it to 10,15 or something....
```
public static function isPhoneNumber($number)
{
$phoneNumber = preg_replace("/[+. ()-]/", "", $number);
return (bool)preg_match('/^[0-9]{7,15}$/', $phoneNumber);
}
```
This is a replacement for the function in /classes/Validate.php