Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_REST_Authentication::get_credentials( string $key_var, string $secret_var )
Locate credentials in the $_SERVER superglobal.
Parameters Parameters
- $key_var
-
(string) (Required) Variable name for the consumer key.
- $secret_var
-
(string) (Required) Variable name for the consumer secret.
Return Return
(array|false)
Source Source
File: libraries/lifterlms-rest/includes/class-llms-rest-authentication.php
*/ private function get_credentials( $key_var, $secret_var ) { // Use `filter_var()` instead of `llms_filter_input()` due to PHP bug with `filter_input()`: https://bugs.php.net/bug.php?id=49184. $key = isset( $_SERVER[ $key_var ] ) ? sanitize_text_field( filter_var( wp_unslash( $_SERVER[ $key_var ] ) ) ) : null; $secret = isset( $_SERVER[ $secret_var ] ) ? sanitize_text_field( filter_var( wp_unslash( $_SERVER[ $secret_var ] ) ) ) : null; if ( ! $key || ! $secret ) { return false; } return compact( 'key', 'secret' );
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.1 | Introduced. |