Yoast\WP\SEO\MyYoast_Client\Infrastructure\Encoding

Base64url::decodepublic staticYoast 1.0

Decodes a base64url-encoded string.

Метод класса: Base64url{}

Хуков нет.

Возвращает

Строку|false. The decoded data, or false on failure.

Использование

$result = Base64url::decode( $data );
$data(строка) (обязательный)
The base64url-encoded string.

Код Base64url::decode() Yoast 27.7

public static function decode( string $data ) {
	$remainder = ( \strlen( $data ) % 4 );
	if ( $remainder !== 0 ) {
		$data .= \str_repeat( '=', ( 4 - $remainder ) );
	}

	// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode -- Base64URL decoding per RFC 7515.
	return \base64_decode( \strtr( $data, '-_', '+/' ), true );
}