added class hint space stripping to new perl JSON parser (like the legacy one does...
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 18 Jul 2007 19:59:47 +0000 (19:59 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 18 Jul 2007 19:59:47 +0000 (19:59 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/branches/new-json2@1047 9efc2488-bf62-4759-914b-345cdb29e865

src/perlmods/OpenSRF/Utils/JSON.pm

index f0e6981..c78ec48 100644 (file)
@@ -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);