liquid_feedback_frontend

view env/ldap/escape_filter.lua @ 1192:bf158c59f827

Improved installation instructions (use www-data for starting Moonbridge)
author jbe
date Mon Apr 13 12:49:11 2015 +0200 (2015-04-13)
parents 58f48a8a202a
children
line source
1 -- Escape a string to be used as safe LDAP filter
2 -- --------------------------------------------------------------------------
3 --
4 -- arguments:
5 -- filter: the string to be escaped (required)
6 --
7 -- returns:
8 -- escaped_filter: the escaped result
10 function ldap.escape_filter(filter)
12 local null_pattern = (_VERSION == "Lua 5.1") and "%z" or "\000"
14 return string.gsub(filter, "[\\%*%(%)\128-\255" .. null_pattern .. "]", function (char)
16 return string.format("%02x", string.byte(char))
18 end)
20 end

Impressum / About Us