Lasso Soft Inc. > Home

[deserialize85]

Linkdeserialize85
AuthorJohan Solve
CategoryTechnical
Version8.5.x
LicensePublic Domain
Posted04 Jun 2009
Updated04 Jun 2009
More by this author...

Description

This tag can be used as replacement for [deserialize] to be able to deserialize data that contains date types and that has been serialized in Lasso 8.1 (or earlier, likely). Thanks for Bil Corry for coming up with the actual fix.

Sample Usage

deserialize85('
	date
	_global_date_
	
		%m/%d/%Y %H:%M:%S
	
	
		false
	
	
		AAAAAAAAAAAAAAAAAAAADAAAAAkAAAAEAAAABQAAAG0AAAAEAAAAmgAAAAEAABwgBoGrUAN9AAD////EAAAAAAAAAAAAAAAA
	
	
');

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define_tag('deserialize85', -required='input', -copy);
	local('datebyte'=null, 'datebyte64_fixed'=null);
	local('datebytes' = string_findregexp(#input,-find='(?s)date.*?([^<]*)'));
	iterate(#datebytes, local('datebyte64'));
		if(loop_count % 2 == 0);
			#datebyte=decode_base64(#datebyte64);
			if(#datebyte -> size > 64);
				#datebyte64_fixed = encode_base64(#datebyte->getrange(4,#datebyte->size - 8));
				#input -> replace(#datebyte64, #datebyte64_fixed);
			/if;
		/if;
	/iterate;
	return(deserialize(#input));
/define_tag;

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft