Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function client:escape(val)
- if nil == val then
- return "NULL"
- end
- if type(val)=="boolean" then
- if val then return "true" else return "false" end
- end
- if type(val)=="number" then
- return tostring(val)
- end
- if type(val)=="table" then
- if type( val.toISOString ) == "function" then
- return val:toISOString()
- else
- return tostring(val)
- end
- end
- -- to escape "\0" in lua, we cannot use string.gsub.
- val = Util.escapeString( val )
- return "'" .. val .. "'"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement