You are here

public function OAuthRequest::set_parameter in OAuth 1.0 7.3

Same name and namespace in other branches
  1. 6.3 lib/OAuth.php \OAuthRequest::set_parameter()
  2. 6 OAuth.php \OAuthRequest::set_parameter()
1 call to OAuthRequest::set_parameter()
OAuthRequest::sign_request in lib/OAuth.php

File

lib/OAuth.php, line 336
OAuth 1.0 server and client library.

Class

OAuthRequest

Code

public function set_parameter($name, $value, $allow_duplicates = true) {
  if ($allow_duplicates && isset($this->parameters[$name])) {

    // We have already added parameter(s) with this name, so add to the list
    if (is_scalar($this->parameters[$name])) {

      // This is the first duplicate, so transform scalar (string)
      // into an array so we can add the duplicates
      $this->parameters[$name] = array(
        $this->parameters[$name],
      );
    }
    $this->parameters[$name][] = $value;
  }
  else {
    $this->parameters[$name] = $value;
  }
}