[Opensrf-commits] r1047 - branches/new-json2/src/perlmods/OpenSRF/Utils

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jul 18 15:59:49 EDT 2007


Author: erickson
Date: 2007-07-18 15:59:47 -0400 (Wed, 18 Jul 2007)
New Revision: 1047

Modified:
   branches/new-json2/src/perlmods/OpenSRF/Utils/JSON.pm
Log:
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

Modified: branches/new-json2/src/perlmods/OpenSRF/Utils/JSON.pm
===================================================================
--- branches/new-json2/src/perlmods/OpenSRF/Utils/JSON.pm	2007-07-18 19:23:45 UTC (rev 1046)
+++ branches/new-json2/src/perlmods/OpenSRF/Utils/JSON.pm	2007-07-18 19:59:47 UTC (rev 1047)
@@ -108,6 +108,8 @@
 	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); 



More information about the opensrf-commits mailing list