From 4dd6b62282ea5b5977dda7a8ef2c8294cc95a8b7 Mon Sep 17 00:00:00 2001 From: selul Date: Wed, 8 Oct 2025 15:01:12 +0300 Subject: [PATCH 1/2] fix: prioritize config over api domain --- inc/config.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/config.php b/inc/config.php index e1c02b965..bb7af7bf2 100644 --- a/inc/config.php +++ b/inc/config.php @@ -121,10 +121,10 @@ public static function init( $service_settings = [] ) { self::$secret = trim( $service_settings['secret'] ); } self::$service_url = sprintf( 'https://%s.%s', self::$key, self::$base_domain ); - if ( isset( $service_settings['domain'] ) && ! empty( $service_settings['domain'] ) ) { - self::$service_url = sprintf( 'https://%s', $service_settings['domain'] ); - } elseif ( defined( 'OPTML_CUSTOM_DOMAIN' ) ) { + if ( defined( 'OPTML_CUSTOM_DOMAIN' ) ) { self::$service_url = constant( 'OPTML_CUSTOM_DOMAIN' ); + }elseif ( isset( $service_settings['domain'] ) && ! empty( $service_settings['domain'] ) ) { + self::$service_url = sprintf( 'https://%s', $service_settings['domain'] ); } $options = [ 'domain' => parse_url( self::$service_url, PHP_URL_HOST ) ]; From 9857da6273bd7d3568b5f1e0dbe815b3cb752131 Mon Sep 17 00:00:00 2001 From: selul Date: Wed, 8 Oct 2025 15:04:17 +0300 Subject: [PATCH 2/2] fix formatting --- inc/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/config.php b/inc/config.php index bb7af7bf2..6bfa38b1d 100644 --- a/inc/config.php +++ b/inc/config.php @@ -123,7 +123,7 @@ public static function init( $service_settings = [] ) { self::$service_url = sprintf( 'https://%s.%s', self::$key, self::$base_domain ); if ( defined( 'OPTML_CUSTOM_DOMAIN' ) ) { self::$service_url = constant( 'OPTML_CUSTOM_DOMAIN' ); - }elseif ( isset( $service_settings['domain'] ) && ! empty( $service_settings['domain'] ) ) { + } elseif ( isset( $service_settings['domain'] ) && ! empty( $service_settings['domain'] ) ) { self::$service_url = sprintf( 'https://%s', $service_settings['domain'] ); }