mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
Fix FLEXIAPI-269 Update the IsNotPhoneNumber rule to use a better phone number validator
This commit is contained in:
parent
2bf8db6bd1
commit
b66cc28004
2 changed files with 3 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ v1.7
|
|||
- Fix FLEXIAPI-264 Add -k|api_key_ip parameter to accounts:create-admin-account to set/clear the related API Key restriction
|
||||
- Fix FLEXIAPI-256 Publish an empty string while deleting a device on Redis to force the refresh on the other clients
|
||||
- Fix FLEXIAPI-268 Allow pn-param in Apple format for the push notifications endpoints
|
||||
- Fix FLEXIAPI-269 Update the IsNotPhoneNumber rule to use a better phone number validator
|
||||
|
||||
v1.6
|
||||
----
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ namespace App\Rules;
|
|||
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
use Respect\Validation\Validator;
|
||||
use Propaganistas\LaravelPhone\PhoneNumber;
|
||||
|
||||
class IsNotPhoneNumber implements Rule
|
||||
{
|
||||
public function passes($attribute, $value): bool
|
||||
{
|
||||
return (Validator::not(Validator::phone())->not(Validator::startsWith('+'))->validate($value));
|
||||
return (new PhoneNumber($value))->getCountry() == null;
|
||||
}
|
||||
|
||||
public function message()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue