kennylerma / facebook-actionscript-api

Automatically exported from code.google.com/p/facebook-actionscript-api
0 stars 0 forks source link

JSON unfriendly values for attachment description and name cause stream.publish to fail #313

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Use the " character or any other character that will be escaped by JSON in 
the name or description of an attachment
2.  Call Facebook.ui("stream.publish", obj);
3. No stream publish dialog is shown

What is the expected output? What do you see instead?
I expect the stream.publish dialog to show

What version of the product are you using? On what operating system?
1.6

Please provide any additional information below.

This is valid JSON
{
    "action_links": [
        {
            "text": "Action Link Name",
            "href": "http://www.example.com"
        }
    ],
    "method": "stream.publish",
    "attachment": {
        "href": "http://www.example.com",
        "media": [
            {
                "imgsrc": "http://www.publicdomainpictures.net/pictures/10000/nahled/cumbrian-slate-mine-26081284195911cMkM.jpg",
                "expanded_height": 398,
                "width": 90,
                "type": "flash",
                "swfsrc": "http://www.adobe.com/content/dotcom/en/devnet/flex/quickstarts/accessing_xml_data/_jcr_content/articlecontentAdobe/generic/file.res/XMLBasics.swf",
                "height": 90,
                "expanded_width": 398
            }
        ],
        "description": "I have a \"quote\"",
        "name": "Testing \\",
        "properties": {
            "Note": {
                "text": "Note",
                "href": "http://www.example.com"
            },
            "Privacy": {
                "text": "Privacy Policy",
                "href": "http://www.example.com"
            }
        }
    },
    "message": ""
}

But, if you tried to do this by creating an ActionScript object, it will fail.

Original issue reported on code.google.com by mike.bje...@gmail.com on 3 Jun 2011 at 8:25

GoogleCodeExporter commented 9 years ago
This is the ActionScript code I am using to stream.publish

var o:Object =
{
    target_id: uid,
    message: message,
    attachment:
    {
        description: desc,
        media: [{
            type: type,
            imgsrc: imgURL,
            width: imgWidth,
            height: imgHeight,
            swfsrc: swfURL,
            expanded_width: swfWidth,
            expanded_height: swfHeight
        }]
        ,name: name
        ,href: link
        ,properties: properties
    },
    action_links:
    [{
        "text": actionName,
        "href": actionLink
    }]
};

Facebook.ui("stream.publish", o, onPublishComplete);

Original comment by mike.bje...@gmail.com on 3 Jun 2011 at 8:31

GoogleCodeExporter commented 9 years ago
Try using " in place of "

Original comment by edwar...@gmail.com on 13 Oct 2011 at 9:28

GoogleCodeExporter commented 9 years ago

Original comment by edwar...@gmail.com on 13 Oct 2011 at 9:29