LLMS_Payment_Gateway::get_secure_strings( string[] $strings, string $handle )

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


Description Description

This is the callback for the llms_secure_strings filter (called via llms_log()).

This method will load the value any gateway option with a secure_option declaration. Additional strings can be added to the list using the llms_get_gateway_secure_strings filter.


Top ↑

Parameters Parameters

$strings

(string[]) (Required) Array of secure strings.

$handle

(string) (Required) The log handle.


Top ↑

Return Return

(string[])


Top ↑

Source Source

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

	public function get_secure_strings( $strings, $handle ) {

		// Don't add our strings to other log files.
		if ( $this->id !== $handle ) {
			return $strings;
		}

		$gateway_strings = array();
		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 strings[] $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_merge( $strings, $gateway_strings );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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