Menu

#10 Some int parsing problems

open
nobody
None
5
2005-11-18
2005-11-18
Anonymous
No

I was passing a data set from php's serialize function
to flash through remoting (dont ask).

The data contained php based objects (coming into the
serializer as type O). An integer in one of my
objects was creating a problem, ruining all parsing
after this intiger.

line ~148 where the buffer is being modified to remove
the recently parsed variable, the length calculated to
start searching for the next ";" is too large for
integers it seems.

this.buffer = this.buffer.substr (this.buffer.indexOf
(";", _value[0] + length(_type) +
length(_value[0].toString())) + 1)

The last value calculated for the indexOf call is to
accomodate the length portion ( s:3:"boo" )of the
serialization string, however the integer messages I'm
getting from php 5 doesnt include this, so I added a
bypass and my code seems to be functioning fine now.

// String Length of the value + string length of the
type + string length of the length variable (if it has one)
var lookAhead:Number = _value[0] + length(_type) +
(_type == "i"?0:length(_value[0].toString()) )
this.buffer = this.buffer.substr (this.buffer.indexOf
(";", lookAhead) + 1)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.