mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:01:22 +00:00
fix(esx_multicharacter/server/modules/database): fix conn string parser
This commit is contained in:
@@ -14,12 +14,12 @@ function Database:GetConnection()
|
||||
self.name = connectionString:sub(connectionString:find("/") + 1, -1):gsub("[%?]+[%w%p]*$", "")
|
||||
self.found = true
|
||||
else
|
||||
local connectionExtracted = { string.strsplit(";", connectionString) }
|
||||
|
||||
for i = 1, #connectionExtracted do
|
||||
local v = connectionExtracted[i]
|
||||
if v:match("database") then
|
||||
self.name = connectionString:sub(connectionString:find("/") + 1, -1):gsub("[%?]+[%w%p]*$", "")
|
||||
local confPairs = { string.strsplit(";", connectionString) }
|
||||
for i = 1, #confPairs do
|
||||
local confPair = confPairs[i]
|
||||
local key, value = confPair:match("^%s*(.-)%s*=%s*(.-)%s*$")
|
||||
if key == "database" then
|
||||
self.name = value
|
||||
self.found = true
|
||||
break
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user