From 689fedb465a41352e518802f2374fdb566907b90 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Mon, 20 Jan 2025 18:24:26 -0300 Subject: [PATCH] Fix tablename --- .../classes/Feature/VectorEmbeddings/Storage/DbTable.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/classes/Feature/VectorEmbeddings/Storage/DbTable.php b/includes/classes/Feature/VectorEmbeddings/Storage/DbTable.php index 46950e3..e8614e9 100644 --- a/includes/classes/Feature/VectorEmbeddings/Storage/DbTable.php +++ b/includes/classes/Feature/VectorEmbeddings/Storage/DbTable.php @@ -132,8 +132,8 @@ public function get( string $text ) { $vectors = $wpdb->get_var( $wpdb->prepare( - 'SELECT vectors FROM %s WHERE hash = %s', - $table_name, + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT vectors FROM {$table_name} WHERE hash = %s", $this->hash_content( $text ) ) ); @@ -155,8 +155,8 @@ public function get_all_object_hashes( int $object_id, string $object_type ): ar $rows = $wpdb->get_results( $wpdb->prepare( - 'SELECT hash, vectors FROM %s WHERE object_id = %d AND object_type = %s', - $table_name, + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT hash, vectors FROM {$table_name} WHERE object_id = %d AND object_type = %s", $object_id, $object_type )