LTI Integration Library 4.10.3
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
OAuthUtil Class Reference

Class to provide OAuth utility methods. More...

Static Public Member Functions

static urlencode_rfc3986 ($input)
 URL encode.
 
static urldecode_rfc3986 ($string)
 URL decode.
 
static split_header ($header, $only_allow_oauth_parameters=true)
 Utility function for turning the Authorization: header into parameters, has to do some unescaping.
 
static get_headers ()
 Helper to try to sort out headers for people who aren't running apache.
 
static parse_parameters ($input)
 Parse parameters.
 
static build_http_query ($params)
 Build HTTP query string.
 

Detailed Description

Class to provide OAuth utility methods.

Version
2008-08-04
Licence: https://opensource.org/licenses/MIT The MIT License

Definition at line 12 of file OAuthUtil.php.

Member Function Documentation

◆ build_http_query()

static build_http_query (   $params)
static

Build HTTP query string.

Parameters
array | null$paramsArray of parameters
Returns
string

Definition at line 171 of file OAuthUtil.php.

References OAuthUtil\urlencode_rfc3986().

Referenced by OAuthRequest\get_signable_parameters(), and OAuthRequest\to_postdata().

◆ get_headers()

static get_headers ( )
static

Helper to try to sort out headers for people who aren't running apache.

Returns
array

Definition at line 83 of file OAuthUtil.php.

Referenced by OAuthRequest\from_request().

◆ parse_parameters()

static parse_parameters (   $input)
static

Parse parameters.

This function takes a input like a=b&a=c&d=e and returns the parsed parameters like this ['a' => ['b','c'], 'd' => 'e']

Parameters
string | null$inputParameter string to be parsed
Returns
array

Definition at line 132 of file OAuthUtil.php.

References OAuthUtil\urldecode_rfc3986().

Referenced by OAuthRequest\__construct(), and OAuthRequest\from_request().

◆ split_header()

static split_header (   $header,
  $only_allow_oauth_parameters = true 
)
static

Utility function for turning the Authorization: header into parameters, has to do some unescaping.

Can filter out any non-oauth parameters if needed (default behaviour) May 28th, 2010 - method updated to tjerk.meesters for a speed improvement. see http://code.google.com/p/oauth/issues/detail?id=163

Parameters
string$headerHeader value
bool$only_allow_oauth_parametersTrue if only OAuth parameters are allowed
Returns
array

Definition at line 62 of file OAuthUtil.php.

References OAuthUtil\urldecode_rfc3986().

Referenced by OAuthRequest\from_request().

◆ urldecode_rfc3986()

static urldecode_rfc3986 (   $string)
static

URL decode.

This decode function isn't taking into consideration the above modifications to the encoding process. However, this method doesn't seem to be used anywhere so leaving it as is.

Parameters
string$stringString to be decoded
Returns
string

Definition at line 44 of file OAuthUtil.php.

Referenced by OAuthUtil\parse_parameters(), and OAuthUtil\split_header().

◆ urlencode_rfc3986()


The documentation for this class was generated from the following file: