From 196f4d3d171b79e19650182c645f854643439c9e Mon Sep 17 00:00:00 2001 From: Mat Lipe Date: Fri, 28 Oct 2022 12:58:13 -0500 Subject: [PATCH] Fix retrieval of get_post_table_characterset (#231) Query command run through `assoc_args_to_str` get double quotes truncated and fail to execute. Using single quotes in the query prevent error. `Warning: Failed to get current character set of the posts table. Reason: ERROR at line 1: Unknown command '\_'` Error may be more prominent on windows. --- src/DB_Command.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DB_Command.php b/src/DB_Command.php index e51fc1dc..3161e7c2 100644 --- a/src/DB_Command.php +++ b/src/DB_Command.php @@ -657,8 +657,8 @@ private function get_posts_table_charset( $assoc_args ) { . 'FROM information_schema.`TABLES` T, ' . 'information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA ' . 'WHERE CCSA.collation_name = T.table_collation ' - . 'AND T.table_schema = "' . DB_NAME . '" ' - . 'AND T.table_name LIKE "%\_posts";'; + . "AND T.table_schema = '" . DB_NAME . "' " + . "AND T.table_name LIKE '%\_posts';"; list( $stdout, $stderr, $exit_code ) = self::run( sprintf(