mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Fix shinanigans with both multiple and global settings not being stored correctly in datastore
This commit is contained in:
parent
8cafded894
commit
9535c04142
1 changed files with 12 additions and 11 deletions
|
|
@ -236,6 +236,18 @@ function helpers.load_variables(all_variables, plugins)
|
|||
if all_variables[setting] then
|
||||
variables["global"][setting] = all_variables[setting]
|
||||
end
|
||||
if data.multiple then
|
||||
for variable, value in pairs(all_variables) do
|
||||
local _, server_name, multiple_setting = variable:match("((%S*_?)(" .. setting .. "_%d+))")
|
||||
if multiple_setting then
|
||||
if multisite and server_name and server_name:match("%S+_$") then
|
||||
variables[server_name:sub(1, -2)][multiple_setting] = value
|
||||
else
|
||||
variables["global"][multiple_setting] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if multisite then
|
||||
for i, server_name in ipairs(server_names) do
|
||||
local key = server_name .. "_" .. setting
|
||||
|
|
@ -244,17 +256,6 @@ function helpers.load_variables(all_variables, plugins)
|
|||
end
|
||||
end
|
||||
end
|
||||
if data.multiple then
|
||||
for variable, value in pairs(all_variables) do
|
||||
local _, server_name, multiple_setting = variable:match("((%S*)_)(" .. setting .. "_%d+)")
|
||||
if multiple_setting then
|
||||
if multisite and server_name and server_name ~= "" then
|
||||
variables[server_name][multiple_setting] = value
|
||||
end
|
||||
variables["global"][multiple_setting] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return true, variables
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue