diff --git a/plugins/woocommerce/changelog/46819-fix-ai-site-title-comparison b/plugins/woocommerce/changelog/46819-fix-ai-site-title-comparison new file mode 100644 index 00000000000..2da46760f2e --- /dev/null +++ b/plugins/woocommerce/changelog/46819-fix-ai-site-title-comparison @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +[CYS] Fix the AI-generated site title comparison. \ No newline at end of file diff --git a/plugins/woocommerce/src/StoreApi/Routes/V1/AI/StoreTitle.php b/plugins/woocommerce/src/StoreApi/Routes/V1/AI/StoreTitle.php index c0c69ae357f..0c345722d92 100644 --- a/plugins/woocommerce/src/StoreApi/Routes/V1/AI/StoreTitle.php +++ b/plugins/woocommerce/src/StoreApi/Routes/V1/AI/StoreTitle.php @@ -63,21 +63,21 @@ class StoreTitle extends AbstractRoute { * @return array An array of endpoints. */ public function get_args() { - return [ - [ + return array( + array( 'methods' => \WP_REST_Server::CREATABLE, - 'callback' => [ $this, 'get_response' ], - 'permission_callback' => [ Middleware::class, 'is_authorized' ], - 'args' => [ - 'business_description' => [ + 'callback' => array( $this, 'get_response' ), + 'permission_callback' => array( Middleware::class, 'is_authorized' ), + 'args' => array( + 'business_description' => array( 'description' => __( 'The business description for a given store.', 'woocommerce' ), 'type' => 'string', - ], - ], - ], - 'schema' => [ $this->schema, 'get_public_item_schema' ], - 'allow_batch' => [ 'v1' => true ], - ]; + ), + ), + ), + 'schema' => array( $this->schema, 'get_public_item_schema' ), + 'allow_batch' => array( 'v1' => true ), + ); } /** @@ -100,8 +100,8 @@ class StoreTitle extends AbstractRoute { ); } - $store_title = get_option( 'blogname' ); - $previous_ai_generated_title = get_option( 'ai_generated_site_title' ); + $store_title = html_entity_decode( get_option( 'blogname' ) ); + $previous_ai_generated_title = html_entity_decode( get_option( 'ai_generated_site_title' ) ); if ( self::DEFAULT_TITLE === $store_title || ( ! empty( $store_title ) && $previous_ai_generated_title !== $store_title ) ) { return rest_ensure_response( array( 'ai_content_generated' => false ) );