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

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.1-BETA1
    • PHP
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: