llms_is_option_secure( string $secure_name )

Determines if the given option name is stored in a “secure” manner, i.e. an environment variable or a constant.


Parameters Parameters

$secure_name

(string) (Required) The name of the possibly secure option.


Top ↑

Return Return

(bool) Returns true if the option is defined in an environment variable or a constant, else false.


Top ↑

Source Source

File: includes/functions/llms-functions-options.php

function llms_is_option_secure( $secure_name ) {

	// Sanity check for empty strings to prevent `getenv()` from returning ALL variables.
	if ( '' === $secure_name ) {
		return false;
	}

	/*
	 * Note: Do not store `false` values in an environment variable
	 * because `getenv()` returns `false` if the variable is not set.
	 */
	if ( false !== getenv( $secure_name ) ) {
		return true;
	}

	return defined( $secure_name );
}

Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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