Hi Guys,Currently, if you store a phone number in this format: +44 (0) 1234 567 890 it will save like this: 4401234567890.Now, I can see why the phone numbers were stored this way (it's easier to validate as a phone number if you just store digits, plus the database can be set to numbers only rather than varchar), and honestly, it wouldn't be a problem if all our offices and clients were in the same country.However, could there be some way to save phone numbers in this format? Perhaps it's possible to compromise by adding a national prefix field?

I agree.  Also for those of us in the states if we could have the number presented as (000) 000-0000 as well as requiring the area code as mandatory in addition to the actual phone number for those of us that provide support across multiple states it would be extremely helpful.

8 years later

As a hack, you can modify the function is_formula in include/class.validator.php to ignore the plus-sign, so that it looks like this:

static function is_formula($text, &$error='') {
        if (!preg_match('/(^[^=@-].*$)|(^\d+$)/s', $text))
            $error = __('Content cannot start with the following characters: = - @');
        return $error == '';
    }

    cbiere

    Just be careful, if you use Windows especially, this will open you up to Formula Injection vulnerabilities.

    Cheers.

    Write a Reply...