From f17a222fd71b04e677cf5cd9b206a3ca31e91ba4 Mon Sep 17 00:00:00 2001 From: Steve Hannah Date: Wed, 26 Oct 2022 05:48:10 -0700 Subject: [PATCH] Changed mysql charset to utf8mb4 from utf8 because utf8 is an alias for utf8mb3 which doesn't support emojis. --- Dataface/Application.php | 6 +++--- xf/db/Database.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dataface/Application.php b/Dataface/Application.php index 2ef4a15a..a54b08f8 100644 --- a/Dataface/Application.php +++ b/Dataface/Application.php @@ -979,11 +979,11 @@ function __construct($conf = null) { define('XF_OUTPUT_ENCODING', $this->_conf['oe']); if ( $this->_conf['oe'] == 'UTF-8' ){ - $res = xf_db_query('set character_set_results = \'utf8\'', $this->_db); - xf_db_query("SET NAMES utf8", $this->_db); + $res = xf_db_query('set character_set_results = \'utf8mb4\'', $this->_db); + xf_db_query("SET NAMES utf8mb4", $this->_db); } if ( $this->_conf['ie'] == 'UTF-8' ){ - $res = xf_db_query('set character_set_client = \'utf8\'', $this->_db); + $res = xf_db_query('set character_set_client = \'utf8mb4\'', $this->_db); } diff --git a/xf/db/Database.php b/xf/db/Database.php index 71f39974..da49399a 100644 --- a/xf/db/Database.php +++ b/xf/db/Database.php @@ -34,9 +34,9 @@ public function db() { $conf = $this->conf; $this->db = xf_db_connect($conf['host'], $conf['user'], $conf['password'], true /* necessary to force new link */); xf_db_select_db($conf['name'], $this->db); - xf_db_query('set character_set_results = \'utf8\'', $this->db); - xf_db_query("SET NAMES utf8", $this->db); - xf_db_query('set character_set_client = \'utf8\'', $this->db); + xf_db_query('set character_set_results = \'utf8mb4\'', $this->db); + xf_db_query("SET NAMES utf8mb4", $this->db); + xf_db_query('set character_set_client = \'utf8mb4\'', $this->db); unset($this->conf); } return $this->db;