You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 21, 2018. It is now read-only.
I've noticed that when the regular expression spans multiple lines (as most of them), the formatting doens't work correctly because the regular expression breaks.
This can be seen by trying to format the number +3224019700 (BE).
This can be solved by changing the __construct function of the Matcher class in PhoneNumberUtil.php to:
I'm not sure it's the same issue. I'm reporting this on a linux machine, so the line-encodings should be \n. Also, the pull request fixes just one regexp.
My impression was that the two issues are similar enough -- both are problems caused by failing to remove line breaks from the NationalNumberPattern regexps -- that they should both be fixed by the same patch. So if the existing pull request doesn't fix your problem, does that existing patch need to be changed?
In regards to your fix, I'm worried about indiscriminately removing all spaces from all regexps. For example, I know that some of the regexps to identify extensions intentionally include spaces as characters that need to be matched; removing those spaces from the pattern would break those regexps. So I'm guessing it would be preferable to isolate which specific regexps are causing the problem, and apply corrections only where necessary.
Personally, I've been testing the module both in linux and mac10.7, and haven't encountered this issue, which in part is why I incorrectly assumed that it was only happening in Windows. Just to be sure I understand the problem, does the following code snippet trigger the problem?
$phoneUtil = PhoneNumberUtil::getInstance();
$phoneObj = $phoneUtil->parseAndKeepRawInput('+3224019700', 'BE');
$isValid = $phoneUtil->isValidNumber($phoneObj);
echo "isValid=$isValid" . PHP_EOL;
echo $phoneUtil->format($phoneObj, PhoneNumberFormat::INTERNATIONAL) . PHP_EOL;
And is it triggered by the parse function, the isValidNumber function, or the format function?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've noticed that when the regular expression spans multiple lines (as most of them), the formatting doens't work correctly because the regular expression breaks.
This can be seen by trying to format the number +3224019700 (BE).
This can be solved by changing the __construct function of the Matcher class in PhoneNumberUtil.php to:
The text was updated successfully, but these errors were encountered: