Skip to content

isMobilePhone accept invalid phone numbers #2055

@ValeriyaZavozova

Description

@ValeriyaZavozova

Describe the bug
A clear and concise description of what the bug is.

isMobilePhone successfully validates invalid numbers (see examples below).
I suppose the problem is in the next regular expressions:
'ro-RO': /^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,
'ms-MY': /^(\+?6?01){1}(([0145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,

Examples
If applicable, add screenshots to help explain your problem.

The next numbers will be accepted as valid even though the are not:
+0711419752
+0765351689
+0111419752

Additional context
Validator.js version: 13.7.0
Node.js version: v18.9.1
OS platform: [windows, linux, macOS, etc] macOS

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions