From: miker Date: Fri, 29 Jul 2005 23:57:43 +0000 (+0000) Subject: fixing number bug in JSON X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d3355317453de8853a04da4c0b5b7196c725fdc4;p=opensrf%2Fbjwebb.git fixing number bug in JSON git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@443 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/JSON.pm b/src/perlmods/JSON.pm index 0b0e16b..1f1177c 100644 --- a/src/perlmods/JSON.pm +++ b/src/perlmods/JSON.pm @@ -223,7 +223,7 @@ sub perl2JSON { $perl =~ s/\r/\\r/sgo; $perl =~ s/\n/\\n/sgo; $perl =~ s/(\pM)/sprintf('\u%0.4x',ord($1))/sgoe; - if ($perl =~ /^(?:\+|-)?\d*\.?\d+$/) { + if (length($perl) < 10 and $perl =~ /^(?:\+|-)?\d*\.?\d+$/) { $output = $perl; } else { $output = '"'.$perl.'"';