Uploaded image for project: 'Shindig'
  1. Shindig
  2. SHINDIG-1063

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1-BETA1
    • Component/s: PHP
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chabotc Chris Chabot
                Reporter:
                kurrik Arne Roomann-Kurrik
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: