-- What steps will reproduce the problem?
1. Build a SabreAMF_OutputStream, with a SabreAMF_TypedObject object in it :
$amfResponse = new SabreAMF_Message();
$amfResponse->addBody(array(
'target' => '/onResult',
'response' => '',
'data' => array(
'myobj' => new SabreAMF_TypedObject('my.path.to.classname',
array('foo' => 'bar', 'baz' => 'foo')),
'foo' => 'bar'
)
);
$amfOutputStream = new SabreAMF_OutputStream();
$amfResponse->serialize($amfOutputStream);
2. Build a SabreAMF_InputStream from this SabreAMF_OutputStream:
$amfInputStream = new SabreAMF_InputStream($amfOutputStream->getRawData());
$amfResponse2 = new SabreAMF_Message();
$amfResponse2->deserialize($amfInputStream);
3. Watch the result :
$bodies = $amfResponse2->getBodies();
var_dump($bodies[0]['data']->body);
-- What is the expected output? What do you see instead?
I'm expecting something like :
array(
'myobj' => new SabreAMF_TypedObject('my.path.to.classname',
array('foo' => 'bar', 'baz' => 'foo')),
'foo' => 'bar'
)
But I get :
array(
'myobj' => new SabreAMF_TypedObject(false,
array('foo' => 'bar', 'baz' => 'foo')),
'foo' => 'bar'
)
The class of the SabreAMF_TypedObject is set to false.
-- What version of the product are you using? On what operating system?
Windows XP, SabreAMF 1.3
-- Please provide any additional information below.
I have a fix :
In SabreAMF_AMF0_Deserializer::readTypedObject(), replace :
if ($classname = $this->getLocalClassName($classname)) {
$rObject = new $classname();
$isMapped = true;
} else {
$rObject = new SabreAMF_TypedObject($classname,null);
}
By :
if ($localClassName = $this->getLocalClassName($classname)) {
$rObject = new $localClassName();
$isMapped = true;
} else {
$rObject = new SabreAMF_TypedObject($classname,null);
}
Original issue reported on code.google.com by thepurpl...@gmail.com on 1 Oct 2009 at 1:42
Original issue reported on code.google.com by
thepurpl...@gmail.com
on 1 Oct 2009 at 1:42