private function getSortedAndEncodedParams(OAuthRequest $request)
 {
     $params = array();
     MapUtils::decodeAndAppendEntries($request->getQueryStringParams(), $params);
     MapUtils::decodeAndAppendEntries($request->getBodyParams(), $params);
     MapUtils::decodeAndAppendEntries($request->getOauthParameters(), $params);
     $params = MapUtils::sort($params);
     return URLUtils::percentEncode(MapUtils::concatSortedPercentEncodedParams($params));
 }
Exemplo n.º 2
0
 public function extract(OAuthRequest $request)
 {
     $this->checkPreconditions($request);
     $parameters = MapUtils::sort($request->getOauthParameters());
     $header = self::PREAMBLE;
     foreach ($parameters as $key => $value) {
         if (strlen($header) > strlen(self::PREAMBLE)) {
             $header .= self::PARAM_SEPARATOR;
         }
         $header .= sprintf("%s=\"%s\"", $key, URLUtils::percentEncode($value));
     }
     return $header;
 }