Skip to content

Commit

Permalink
hotfix for broken http_build_query method in PHP 5.5.32
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberer committed Dec 10, 2017
1 parent cf3ddef commit dc1fba3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plenigo/internal/utils/RestClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@ private function __construct($curlRequest, $inFile = null) {
*
* Replace http_build_query due to an error in this method.
*
* Token from https://davidwalsh.name/curl-post
* Taken from https://davidwalsh.name/curl-post
*
* @param array $params parameter array to pass to webservice.
* @return string query-string
*/
private static function buildQuery($params = array()) {
$fields_string = '';
//url-ify the data for the POST
foreach($params as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
foreach($params as $key=>$value) {
$fields_string .= $key.'='. rawurldecode($value) .'&';
}
$fields_string = rtrim($fields_string, '&');

// taking out the brackets because we need to use the very same variable name
Expand Down

0 comments on commit dc1fba3

Please sign in to comment.