🚑 fix(PhoneNumberAttribute) Use pattern instead of method to validate phone numbers
So that the pattern is also set in the HTML input issue #5910
So that the pattern is also set in the HTML input issue #5910
... | ... | @@ -108,11 +108,15 @@ class phoneSelectDialog extends GenericDialog |
/*! \brief This class allow to handle easily an LDAP attribute that contains a phone number | ||
*/ | ||
class PhoneNumberAttribute extends TestValidateAttribute | ||
class PhoneNumberAttribute extends StringAttribute | ||
{ | ||
protected $trim = TRUE; | ||
protected $testFunc = 'is_phone_nr'; | ||
protected $inputType = 'tel'; | ||
function __construct ($label, $description, $ldapName, $required = FALSE, $defaultValue = '', $acl = '', $regexp = '/^[\/0-9 ()+*-]+$/', $example = NULL) | ||
Please
register
or
sign in
to reply
|
||
{ | ||
parent::__construct($label, $description, $ldapName, $required, $defaultValue, $acl, $regexp, $example); | ||
} | ||
} | ||
/*! \brief Displays a text field and a button to select the phone from object list | ||
... | ... |
SonarQube analysis reported 1 issue
Watch the comments in this conversation to review them.