Skip to content

Commit

Permalink
Merge branch 'doug777-patch-1' into develop
Browse files Browse the repository at this point in the history
Add new variable "flexTraitFound" and change readScriptObject() to allow ArrayCollection and ObjectProxy objects sent from CF to be correctly decoded. This change should not affect anything other than this. (Note that ObjectProxy is not tested, so a further change could be necessary and I will do this when I can test it with an ObjectProxy.) #239
  • Loading branch information
carlosrovira committed May 18, 2018
2 parents 870fc4d + 396fbd6 commit 79df072
Showing 1 changed file with 16 additions and 8 deletions.
Expand Up @@ -150,6 +150,8 @@ public class AMFBinaryData
private var stringCount:int = 0;
private var traitCount:int = 0;
private var objectCount:int = 0;

private var flexTraitFound:Boolean = false;

public var pos:int = 0;

Expand Down Expand Up @@ -871,11 +873,20 @@ public class AMFBinaryData
{
var ref:int = this.readUInt29();
if ((ref & 1) == 0)
return this.getObject(ref >> 1);
{
this.flexTraitFound = false;
return this.getObject(ref >> 1);
}
else
{
var traits:Traits = this.readTraits(ref);
var obj:Object;
if (traits.alias == "flex.messaging.io.ArrayCollection"
|| traits.alias == "flex.messaging.io.ObjectProxy")
{
traits.alias = "";
this.flexTraitFound = true;
}
var obj:Object;
if (traits.alias) {
var c:Class = getClassByAlias(traits.alias);
if (c)
Expand All @@ -892,13 +903,10 @@ public class AMFBinaryData
}
this.rememberObject(obj);
if (traits.externalizable)
{
if (obj[CLASS_ALIAS] == "flex.messaging.io.ArrayCollection"
|| obj[CLASS_ALIAS] == "flex.messaging.io.ObjectProxy")
return this.readObject();
if (this.flexTraitFound)
obj = this.readObject();
else
obj[EXTERNALIZED_FIELD] = this.readObject();
}
obj[EXTERNALIZED_FIELD] = this.readObject();
else
{
for (var i:int in traits.props)
Expand Down

0 comments on commit 79df072

Please sign in to comment.