davideme / libphonenumber-for-PHP

PHP version of Google's phone number handling library
125 stars 71 forks source link

Matcher class freaks out on line breaks in the meta data #25

Open wirtsi opened 11 years ago

wirtsi commented 11 years ago

For me the formatting of the number yielded wrong results ... after a lot of tracing around, I found out that the Matcher class has problems with the line breaks present in the meta data files. Changing the constructor to

    $this->pattern = str_replace(array("\r\n", "\r", "\n", " "),'',$pattern);

fixed it. Not sure if there are some regexps which rely on the space, then this would break them

wirtsi