Last active
January 2, 2016 14:19
Revisions
-
piotr-cz revised this gist
Jan 8, 2014 . 1 changed file with 26 additions and 10 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,31 @@ /** * JInstallerHelper::downloadPackage patch to encode redirect url query values. * * File Locations: * - J3.2: /libraries/cms/installer/helper.php * - J2.5: /libraries/joomla/installer/helper.php * * For performance reasons (assuming that initial $url is valid), * this code can be moved just under the `302 == $response->code` check. */ public static function downloadPackage($url, $target = false) { /* JInstallerHelper::downloadPackage patch to encode url query values */ // Using JUri here (not parse_url) to preserve non-query data $uri = new JUri($url); // Get query variables $vars = $uri->getQuery(true); // Encode values array_walk_recursive($vars, 'rawurlencode'); // Set query and convert to string $uri->setQuery($vars); $url = (string) $uri; // Rest of the code //... } -
piotr-cz created this gist
Jan 8, 2014 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ /* JInstallerHelper::downloadPackage patch to encode url query values */ // Using JUri here (not parse_url) to preserve non-query data $uri = new JUri($url); // Get query variables $vars = $uri->getQuery(true); // Encode values array_walk_recursive($vars, 'rawurlencode'); // Set query and convert to string $uri->setQuery($vars); $url = (string) $uri;