[
https://issues.apache.org/jira/browse/SHINDIG-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Chabot deleted SHINDIG-1138:
----------------------------------
> Gadget Url Renderer: parameters substitution
> --------------------------------------------
>
> Key: SHINDIG-1138
> URL: https://issues.apache.org/jira/browse/SHINDIG-1138
> Project: Shindig
> Issue Type: Bug
> Reporter: Dmitry Vorobyev
> Priority: Minor
>
> Substitute __MODULE_ID__ and other parameters in url.
> ### Eclipse Workspace Patch 1.0
> #P shindig
> Index:
> http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/src/gadgets/render/GadgetUrlRenderer.php
> ===================================================================
> ---
> http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/src/gadgets/render/GadgetUrlRenderer.php
> (revision 800379)
> +++
> http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/src/gadgets/render/GadgetUrlRenderer.php
> (working copy)
> @@ -32,9 +32,7 @@
> public function renderGadget(Gadget $gadget, $view) {
> // Preserve existing query string parameters.
> $redirURI = $view['href'];
> - $queryStr = strpos($redirURI, '?') !== false ? substr($redirURI,
> strpos($redirURI, '?')) : '';
> - $query = $queryStr;
> - $query .= $this->getPrefsQueryString($gadget->gadgetSpec->userPrefs);
> + $query = $this->getPrefsQueryString($gadget->gadgetSpec->userPrefs);
> $features = array();
> $forcedLibs = Config::get('focedJsLibs');
> if ($forcedLibs == null) {
> @@ -45,10 +43,15 @@
> $query .= $this->appendLibsToQuery($features);
> $query .= '&lang=' . urlencode(isset($_GET['lang']) ? $_GET['lang'] :
> 'en');
> $query .= '&country=' . urlencode(isset($_GET['country']) ?
> $_GET['country'] : 'US');
> - if (substr($query, 0, 1) == '&') {
> - $query = '?' . substr($query, 1);
> +
> + $redirURI = $gadget->substitutions->substituteUri(null, $redirURI);
> + if (strpos($redirURI, '?') !== false) {
> + $redirURI = $redirURI . $query;
> + } elseif (substr($query, 0, 1) == '&') {
> + $redirURI = $redirURI . '?' . substr($query, 1);
> + } else {
> + $redirURI = $redirURI . '?' . $query;
> }
> - $redirURI .= $query;
> header('Location: ' . $redirURI);
> }
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.