From 7b9629a6b3ef3ed6e3a3f2bfa640fbb177830202 Mon Sep 17 00:00:00 2001 From: Joshua Gigg Date: Thu, 2 Jan 2014 17:12:21 +0000 Subject: [PATCH 1/3] Add hhvm travis testing --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b9547eba3..c0d2e18f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ php: - 5.4 - 5.5 - 5.6 + - hhvm before_script: - wget http://getcomposer.org/composer.phar From 1dcaa5bf44ea9663cd0802434b5a837afa1d4877 Mon Sep 17 00:00:00 2001 From: Joshua Gigg Date: Thu, 24 Apr 2014 19:53:28 +0100 Subject: [PATCH 2/3] Allow HHVM failures until they upgrade to v3 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c0d2e18f5..48b8923ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: php matrix: allow_failures: - 5.6 + - hhvm php: - 5.3 From 20068119bb0c71a6ff1c7460cdaea70c5fd10419 Mon Sep 17 00:00:00 2001 From: Joshua Gigg Date: Wed, 7 May 2014 19:55:46 +0100 Subject: [PATCH 3/3] Use mb_substr when stripping prefix --- src/libphonenumber/PhoneNumberUtil.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libphonenumber/PhoneNumberUtil.php b/src/libphonenumber/PhoneNumberUtil.php index 69c564258..ba0ae8891 100644 --- a/src/libphonenumber/PhoneNumberUtil.php +++ b/src/libphonenumber/PhoneNumberUtil.php @@ -1748,7 +1748,7 @@ public function maybeStripInternationalPrefixAndNormalize(&$number, $possibleIdd // Check to see if the number begins with one or more plus signs. $match = preg_match('/^' . self::$PLUS_CHARS_PATTERN . '/' . self::REGEX_FLAGS, $number, $matches, PREG_OFFSET_CAPTURE); if ($match > 0) { - $number = substr($number, $matches[0][1] + mb_strlen($matches[0][0])); + $number = mb_substr($number, $matches[0][1] + mb_strlen($matches[0][0])); // Can now normalize the rest of the number since we've consumed the "+" sign at the start. $number = $this->normalize($number); return CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN;