LLMS_Payment_Gateway::retrieve_secure_strings()

Retrieves a list of “secure” strings which should be anonymized if they’re found within debug logs.


Description Description

This method will load the values of any gateway options with a secure_option declaration. Additional strings can be added to the list using the llms_get_gateway_secure_strings filter or via the gateway’s add_secure_string() method.


Top ↑

Return Return

(string[])


Top ↑

Source Source

File: includes/abstracts/abstract.llms.payment.gateway.php

	public function retrieve_secure_strings() {

		$gateway_strings = $this->secure_strings;
		foreach ( $this->get_admin_settings_fields() as $field ) {

			if ( empty( $field['id'] ) || empty( $field['secure_option'] ) ) {
				continue;
			}

			$string = llms_get_secure_option( $field['secure_option'], '', $field['id'] );
			if ( empty( $string ) ) {
				continue;
			}

			$gateway_strings[] = $string;

		}

		/**
		 * Filters the list of the gateway's secure strings.
		 *
		 * @since 6.4.0
		 *
		 * @param string[] $gateway_strings List of secure strings for the payment gateway.
		 * @param string   $id              The gateway ID.
		 */
		$gateway_strings = apply_filters( 'llms_get_gateway_secure_strings', $gateway_strings, $this->id );

		return array_values( array_unique( $gateway_strings ) );

	}


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.