From: erickson Date: Wed, 18 Jul 2007 19:59:47 +0000 (+0000) Subject: added class hint space stripping to new perl JSON parser (like the legacy one does... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6015bddfc436327877c14964436b24faf37a3c15;p=OpenSRF.git added class hint space stripping to new perl JSON parser (like the legacy one does) since the legacy gateway code does not strip out the spaces git-svn-id: svn://svn.open-ils.org/OpenSRF/branches/new-json2@1047 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/OpenSRF/Utils/JSON.pm b/src/perlmods/OpenSRF/Utils/JSON.pm index f0e6981..c78ec48 100644 --- a/src/perlmods/OpenSRF/Utils/JSON.pm +++ b/src/perlmods/OpenSRF/Utils/JSON.pm @@ -108,6 +108,8 @@ sub JSONObject2Perl { if( $ref eq 'HASH' ) { if( defined($obj->{$JSON_CLASS_KEY})) { my $cls = $obj->{$JSON_CLASS_KEY}; + $cls =~ s/^\s+//o; + $cls =~ s/\s+$//o; if( $obj = $class->JSONObject2Perl($obj->{$JSON_PAYLOAD_KEY}) ) { $cls = $class->lookup_class($cls) || $cls; return bless(\$obj, $cls) unless ref($obj);