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.


Top ↑

Return Return

(array|false)


Top ↑

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' );



Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.