diff --git a/include/class.forms.php b/include/class.forms.php index e86a07dd09b3a7219c8cc10bf4e5906d559075cb..e782f3ef2b94137e0cf45532acaaaf1a771dd791 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -662,7 +662,9 @@ class PhoneField extends FormField { function parse($value) { // NOTE: Value may have a legitimate 'X' to separate the number and // extension parts. Don't remove the 'X' - return preg_replace('/[^\dX]/', '', $value); + $val = preg_replace('/[^\dX]/', '', $value); + // Pass completely-incorrect string for validation error + return $val ?: $value; } function toString($value) {