You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Arne Roomann-Kurrik (JIRA)" <ji...@apache.org> on 2009/05/19 01:06:45 UTC

[jira] Created: (SHINDIG-1063) ContainerConfig.php regex parses out valid parts of container.js, throws "Failed to json_decode the container configuration"

ContainerConfig.php regex parses out valid parts of container.js, throws "Failed to json_decode the container configuration"
----------------------------------------------------------------------------------------------------------------------------

                 Key: SHINDIG-1063
                 URL: https://issues.apache.org/jira/browse/SHINDIG-1063
             Project: Shindig
          Issue Type: Bug
          Components: PHP
            Reporter: Arne Roomann-Kurrik


The following line in /php/src/gadgets/ContainerConfig.php:
$contents = preg_replace('/[^http:\/\/|^https:\/\/]\/\/.*$/m', '', preg_replace('@/\\*(?:.|[\\n\\r])*?\\*/@', '', $contents));

attemps to parse comments out of container.js.  However, container.js ships with a default setting of:
"gadgets.oauthGadgetCallbackTemplate" : "//%host%/gadgets/oauthcallback",

When run through the preg_replace lines above, this line is converted to:
"gadgets.oauthGadgetCallbackTemplate" : 

which then breaks PHP's ability to parse container.js as a valid json string and throws a "Failed to json_decode the container configuration" exception.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SHINDIG-1063) ContainerConfig.php regex parses out valid parts of container.js, throws "Failed to json_decode the container configuration"

Posted by "Chris Chabot (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-1063?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Chabot resolved SHINDIG-1063.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: trunk
         Assignee: Chris Chabot

I've applied the fix from SHINDIG-1064 which included a unittest, so the issue's been resolved.

Thanks for the investigative work and report Arne!

> ContainerConfig.php regex parses out valid parts of container.js, throws "Failed to json_decode the container configuration"
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SHINDIG-1063
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1063
>             Project: Shindig
>          Issue Type: Bug
>          Components: PHP
>            Reporter: Arne Roomann-Kurrik
>            Assignee: Chris Chabot
>             Fix For: trunk
>
>
> The following line in /php/src/gadgets/ContainerConfig.php:
> $contents = preg_replace('/[^http:\/\/|^https:\/\/]\/\/.*$/m', '', preg_replace('@/\\*(?:.|[\\n\\r])*?\\*/@', '', $contents));
> attemps to parse comments out of container.js.  However, container.js ships with a default setting of:
> "gadgets.oauthGadgetCallbackTemplate" : "//%host%/gadgets/oauthcallback",
> When run through the preg_replace lines above, this line is converted to:
> "gadgets.oauthGadgetCallbackTemplate" : 
> which then breaks PHP's ability to parse container.js as a valid json string and throws a "Failed to json_decode the container configuration" exception.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.