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
573c505280
commit
21ff64cf2f
2 changed files with 3 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ v1.6
|
|||
- Fix FLEXIAPI-262 Bypass the JWT auth if we have an API Key
|
||||
- Fix FLEXIAPI-264 Add -k|api_key_ip parameter to accounts:create-admin-account to set/clear the related API Key restriction
|
||||
- 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.5
|
||||
---
|
||||
|
|
|
|||
|
|
@ -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