You are here

private function LingotekOAuthRequest::getRequestBodyOfMultipart in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.4 lib/oauth-php/library/LingotekOAuthRequest.php \LingotekOAuthRequest::getRequestBodyOfMultipart()
  2. 7.5 lib/oauth-php/library/LingotekOAuthRequest.php \LingotekOAuthRequest::getRequestBodyOfMultipart()
  3. 7.6 lib/oauth-php/library/LingotekOAuthRequest.php \LingotekOAuthRequest::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)

File

lib/oauth-php/library/LingotekOAuthRequest.php, line 690

Class

LingotekOAuthRequest
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 . '=' . url_check($this
          ->urlencode($v)) . '&';
      }

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

      #end if
    }

    #end if
  }

  #end if
  return $body;
}