WC_API_Authentication::normalize_parameters()
Normalize each parameter by assuming each parameter may have already been encoded, so attempt to decode, and then re-encode according to RFC 3986
Note both the key and value is normalized so a filter param like:
'filter[period]' => 'week'
is encoded to:
'filter%5Bperiod%5D' => 'week'
This conforms to the OAuth 1.0a spec which indicates the entire query string should be URL encoded
Метод класса: WC_API_Authentication{}
Хуков нет.
Возвращает
Массив
. normalized parameters
Использование
// private - только в коде основоного (родительского) класса $result = $this->normalize_parameters( $parameters );
- $parameters(массив) (обязательный)
- un-normalized parameters
Заметки
- Смотрите: rawurlencode()
Список изменений
С версии 2.1 | Введена. |
Код WC_API_Authentication::normalize_parameters() WC API Authentication::normalize parameters WC 8.7.0
private function normalize_parameters( $parameters ) { $keys = WC_API_Authentication::urlencode_rfc3986( array_keys( $parameters ) ); $values = WC_API_Authentication::urlencode_rfc3986( array_values( $parameters ) ); $parameters = array_combine( $keys, $values ); return $parameters; }