Closed pzupan closed 2 years ago
Which version is this about?
On Monday, 5 June 2017, Paul Zupan notifications@github.com wrote:
I have a user trying to enter his croation telephone number +385 98 352 085 and it is being rejected.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/floere/phony/issues/379, or mute the thread https://github.com/notifications/unsubscribe-auth/AAALznWSJ2w2s7adT-pF0sdOlKoluLzjks5sA4s7gaJpZM4NvpL4 .
Sorry. 2.15.43
Could you try 2.15.45 and report back, please?
On Monday, 5 June 2017, Paul Zupan notifications@github.com wrote:
Sorry. 2.15.43
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/floere/phony/issues/379#issuecomment-306219441, or mute the thread https://github.com/notifications/unsubscribe-auth/AAALztvYhlNqg681ug3GyAxC1SNPvAgrks5sBB9-gaJpZM4NvpL4 .
Still getting the error with 2.15.45.
{:phone=>[{:error=>:improbable_phone}]}
@saner @ronin Can you help with this issue? :) (Croatia just got an update via https://github.com/floere/phony/pull/375, however this issue existed pre-update as well)
Hold on. I'm doing some further testing. This could be an issue with phony_rails...
@pzupan @floere @saner I've checked this number on version 2.15.45 (sha fd09a14ced90dde1316b988b5001a78665632559) and it is accepted.
main:0> Phony.normalize "+385 98 352 085"
=> "38598352085"
main:0> Phony.plausible? "+385 98 352 085"
=> true
Phony.plausible? "+385 98 352 085" is failing in phony_rails as the local splitter is looking for a length of 7 and the remainder after the national splitter is 6.
# lib/phony/local_splitters/fixed.rb 50
def plausible? rest, hints = {}
@length === rest.inject(0) { |total, part| total + part.size }
end
I haven't tracked down how the splitter is working yet, but I think the template in croatia.rb is:
match(/^(9\d)/) >> split(3, 3..4) | # Mobile
Should this result in a @length of 6?
I have a user trying to enter his croation telephone number +385 98 352 085 and it is being rejected.