This commit is contained in:
Emili Castells Guasch 2024-08-07 12:47:11 +02:00
parent 7778cfafed
commit 939991c42f
2 changed files with 4 additions and 4 deletions

View file

@ -80,6 +80,10 @@ class SdkClientToken {
* @throws RuntimeException If something unexpected happens.
*/
public function sdk_client_token(): string {
if ( $this->cache->has( self::CACHE_KEY ) ) {
return $this->cache->get( self::CACHE_KEY );
}
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$domain = wp_unslash( $_SERVER['HTTP_HOST'] ?? '' );
$domain = preg_replace( '/^www\./', '', $domain );