mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
[database] Handle NULL literal in params (#6581)
This commit is contained in:
@@ -41,6 +41,7 @@ local function apply_params(db, sql, params)
|
||||
|
||||
local str = string.gsub(sql, param_pattern, function(param)
|
||||
local v, t = params[param], type(params[param])
|
||||
if "NULL" == v then return 'NULL' end
|
||||
if "string" == t then return db:quote(v) end
|
||||
if "number" == t then return tostring(v) end
|
||||
if "boolean" == t then return v and '1' or '0' end
|
||||
|
||||
Reference in New Issue
Block a user