From 5d72f0e3b225b809b378f85d45747500505d7005 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 26 May 2022 16:58:37 -0400 Subject: [PATCH] Core/DBLayer: escape MySQL keywords in page_text, page_text_locale, broadcast_text and broadcast_text_locale select queries Port From (https://github.com/TrinityCore/TrinityCore/commit/209b90cfdd2d483ab90dfb59746c0053511899d7) --- Source/Framework/Database/Databases/HotfixDatabase.cs | 2 +- Source/Game/Globals/ObjectManager.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Framework/Database/Databases/HotfixDatabase.cs b/Source/Framework/Database/Databases/HotfixDatabase.cs index 3e092b985..7a2dce966 100644 --- a/Source/Framework/Database/Databases/HotfixDatabase.cs +++ b/Source/Framework/Database/Databases/HotfixDatabase.cs @@ -187,7 +187,7 @@ namespace Framework.Database " FROM battlemaster_list_locale WHERE locale = ?"); // BroadcastText.db2 - PrepareStatement(HotfixStatements.SEL_BROADCAST_TEXT, "SELECT Text, Text1, ID, LanguageID, ConditionID, EmotesID, Flags, ChatBubbleDurationMs, " + + PrepareStatement(HotfixStatements.SEL_BROADCAST_TEXT, "SELECT `Text`, Text1, ID, LanguageID, ConditionID, EmotesID, Flags, ChatBubbleDurationMs, " + "VoiceOverPriorityID, SoundKitID1, SoundKitID2, EmoteID1, EmoteID2, EmoteID3, EmoteDelay1, EmoteDelay2, EmoteDelay3 FROM broadcast_text"); PrepareStatement(HotfixStatements.SEL_BROADCAST_TEXT_LOCALE, "SELECT ID, Text_lang, Text1_lang FROM broadcast_text_locale WHERE locale = ?"); diff --git a/Source/Game/Globals/ObjectManager.cs b/Source/Game/Globals/ObjectManager.cs index 8d42b9e39..3ca6d6215 100644 --- a/Source/Game/Globals/ObjectManager.cs +++ b/Source/Game/Globals/ObjectManager.cs @@ -8821,7 +8821,7 @@ namespace Game _pageTextLocaleStorage.Clear(); // needed for reload case // 0 1 2 - SQLResult result = DB.World.Query("SELECT ID, locale, Text FROM page_text_locale"); + SQLResult result = DB.World.Query("SELECT ID, locale, `Text` FROM page_text_locale"); if (result.IsEmpty()) return; @@ -9355,7 +9355,7 @@ namespace Game uint oldMSTime = Time.GetMSTime(); // 0 1 2 3 4 - SQLResult result = DB.World.Query("SELECT ID, text, NextPageID, PlayerConditionID, Flags FROM page_text"); + SQLResult result = DB.World.Query("SELECT ID, `text`, NextPageID, PlayerConditionID, Flags FROM page_text"); if (result.IsEmpty()) {