You are here

private function OAuthRequest::getRequestBodyOfMultipart in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.2 lib/oauth-php/library/OAuthRequest.php \OAuthRequest::getRequestBodyOfMultipart()

* Get the body of a POST with multipart/form-data by Edison tsai on 16:52 2010/09/16 * * Used for fetching the post parameters and to calculate the body signature. * *

Return value

string null when no body present (or wrong content type for body)

1 call to OAuthRequest::getRequestBodyOfMultipart()
OAuthRequest::__construct in lib/oauth-php/library/OAuthRequest.php
* Construct from the current request. Useful for checking the signature of a request. * When not supplied with any parameters this will use the current request. * *

File

lib/oauth-php/library/OAuthRequest.php, line 774

Class

OAuthRequest
Object to parse an incoming OAuth request or prepare an outgoing OAuth request

Code

private function getRequestBodyOfMultipart() {
  $body = null;
  if ($this->method == 'POST') {
    $body = '';
    if (is_array($_POST) && count($_POST) > 1) {
      foreach ($_POST as $k => $v) {
        $body .= $k . '=' . $this
          ->urlencode($v) . '&';
      }

      #end foreach
      if (substr($body, -1) == '&') {
        $body = substr($body, 0, strlen($body) - 1);
      }

      #end if
    }

    #end if
  }

  #end if
  return $body;
}