You are here

protected function ServicesClientConnectionOAuthAuth::flattenParamKeys in Services Client 7.2

Same name and namespace in other branches
  1. 7 services_client_connection/modules/services_client_oauth/plugins/ServicesClientConnectionOAuthAuth.inc \ServicesClientConnectionOAuthAuth::flattenParamKeys()

Flatten array keys as they would be sent to in HTTP query.

array('body' => array('und' => array(0 => array('value' => 'val'))))

will get converted to:

array('body[und][0][value]' => 'val');

Parameters

array $params: HTTP query params

Return value

array Array of params with flattened keys structure

1 call to ServicesClientConnectionOAuthAuth::flattenParamKeys()
ServicesClientConnectionOAuthAuth::getRequestParams in services_client_connection/modules/services_client_oauth/plugins/ServicesClientConnectionOAuthAuth.inc
Determine which params should be included in signing

File

services_client_connection/modules/services_client_oauth/plugins/ServicesClientConnectionOAuthAuth.inc, line 213

Class

ServicesClientConnectionOAuthAuth
OAuth authentication support

Code

protected function flattenParamKeys($params) {
  $string = http_build_query($params, NULL, '&');
  $rows = explode('&', $string);
  $out = array();
  foreach ($rows as $row) {
    list($key, $val) = explode('=', $row);
    $out[urldecode($key)] = urldecode($val);
  }
  return $out;
}