You are here

private function LingotekOAuthRequest::getRequestBodyOfMultipart in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.7 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)

1 call to LingotekOAuthRequest::getRequestBodyOfMultipart()
LingotekOAuthRequest::__construct in lib/oauth-php/library/LingotekOAuthRequest.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/LingotekOAuthRequest.php, line 774

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

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

      #end if
    }

    #end if
  }

  #end if
  return $body;
}