Skip to content

Commit 2006811

Browse files
committed
Use mb_substr when stripping prefix
1 parent 1dcaa5b commit 2006811

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libphonenumber/PhoneNumberUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ public function maybeStripInternationalPrefixAndNormalize(&$number, $possibleIdd
17481748
// Check to see if the number begins with one or more plus signs.
17491749
$match = preg_match('/^' . self::$PLUS_CHARS_PATTERN . '/' . self::REGEX_FLAGS, $number, $matches, PREG_OFFSET_CAPTURE);
17501750
if ($match > 0) {
1751-
$number = substr($number, $matches[0][1] + mb_strlen($matches[0][0]));
1751+
$number = mb_substr($number, $matches[0][1] + mb_strlen($matches[0][0]));
17521752
// Can now normalize the rest of the number since we've consumed the "+" sign at the start.
17531753
$number = $this->normalize($number);
17541754
return CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN;

0 commit comments

Comments
 (0)