mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-28 16:34:13 +01:00
Merge pull request #1349 from prasadvaidya/master
Fix: Replace erlang function with fail-safe jlib function.
This commit is contained in:
commit
ed6bc9081b
@ -629,7 +629,7 @@ generic_sql_query_format(SQLQuery) ->
|
|||||||
|
|
||||||
generic_escape() ->
|
generic_escape() ->
|
||||||
#sql_escape{string = fun(X) -> <<"'", (escape(X))/binary, "'">> end,
|
#sql_escape{string = fun(X) -> <<"'", (escape(X))/binary, "'">> end,
|
||||||
integer = fun(X) -> integer_to_binary(X) end,
|
integer = fun(X) -> jlib:i2l(X) end,
|
||||||
boolean = fun(true) -> <<"1">>;
|
boolean = fun(true) -> <<"1">>;
|
||||||
(false) -> <<"0">>
|
(false) -> <<"0">>
|
||||||
end
|
end
|
||||||
@ -646,7 +646,7 @@ sqlite_sql_query_format(SQLQuery) ->
|
|||||||
|
|
||||||
sqlite_escape() ->
|
sqlite_escape() ->
|
||||||
#sql_escape{string = fun(X) -> <<"'", (standard_escape(X))/binary, "'">> end,
|
#sql_escape{string = fun(X) -> <<"'", (standard_escape(X))/binary, "'">> end,
|
||||||
integer = fun(X) -> integer_to_binary(X) end,
|
integer = fun(X) -> jlib:i2l(X) end,
|
||||||
boolean = fun(true) -> <<"1">>;
|
boolean = fun(true) -> <<"1">>;
|
||||||
(false) -> <<"0">>
|
(false) -> <<"0">>
|
||||||
end
|
end
|
||||||
@ -670,7 +670,7 @@ pgsql_prepare(SQLQuery, State) ->
|
|||||||
|
|
||||||
pgsql_execute_escape() ->
|
pgsql_execute_escape() ->
|
||||||
#sql_escape{string = fun(X) -> X end,
|
#sql_escape{string = fun(X) -> X end,
|
||||||
integer = fun(X) -> [integer_to_binary(X)] end,
|
integer = fun(X) -> [jlib:i2l(X)] end,
|
||||||
boolean = fun(true) -> "1";
|
boolean = fun(true) -> "1";
|
||||||
(false) -> "0"
|
(false) -> "0"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user