function _openid_encode_message

Encode a message from _openid_create_message for HTTP Post

2 calls to _openid_encode_message()
openid_association in modules/openid/openid.module
Attempt to create a shared secret with the OpenID Provider.
openid_verify_assertion in modules/openid/openid.module
Attempt to verify the response received from the OpenID Provider.

File

modules/openid/openid.inc, line 350

Code

function _openid_encode_message($message) {
    $encoded_message = '';
    $items = explode("\n", $message);
    foreach ($items as $item) {
        $parts = explode(':', $item, 2);
        if (count($parts) == 2) {
            if ($encoded_message != '') {
                $encoded_message .= '&';
            }
            $encoded_message .= rawurlencode(trim($parts[0])) . '=' . rawurlencode(trim($parts[1]));
        }
    }
    return $encoded_message;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.