rjray / rpc-xml

A Perl implementation of the XML-RPC specification
https://metacpan.org/release/RPC-XML
24 stars 14 forks source link

In Perl regular expressions, \d matches any digit in any alphabet. Bu… #10

Closed fabzzap closed 8 years ago

fabzzap commented 9 years ago

"Being a digit doesn't make you numeric", a colleague told me

In Perl regular expressions, \d matches any digit in any alphabet. But, in the Perl language, something is only numeric if it is made by ASCII digits.

Because of this, the following line gives a warning.

$ perl -Mstrict -Mwarnings -MRPC::XML -e 'my $a="\x{E55}";my $b=RPC::XML::response->new($a)' Argument "\x{e55}" isn't numeric in numeric ge (>=) at /usr/share/perl5/RPC/XML.pm line 270.

(in Unicode 0E55 is THAI DIGIT FIVE)

This patch adds the modifier a to the regular expressions using \d, so they will only match ASCII digits

rjray commented 9 years ago

Unfortunately, this would break on any Perl prior to 5.14, which is when the /a modifier was added.

I will fix this myself by changing the \d occurrences to [0-9].

fabzzap commented 8 years ago

Any ETA for this fix? P.S. patch attached numbers.patch.txt

rjray commented 8 years ago

My apologies, this slipped off my radar somehow and got forgotten. I will look at getting it in in the next few days. I'm past-due for releasing a new version as it is.

fabzzap commented 8 years ago

Nice idea, a new version with this patch + everything that was done since version 0.79 would be great

rjray commented 8 years ago

OK, I've applied the second patch you suggested, so I'm closing the pull request (without merging). Thanks for this, and thanks for gently reminding me that I'm long overdue for a new release :-).