Skip to content
Snippets Groups Projects
Commit 234b5c9a authored by Bernhard Liebl's avatar Bernhard Liebl
Browse files

Fix for PHP 7, more debugging output

parent f0a15b09
No related branches found
No related tags found
No related merge requests found
......@@ -463,9 +463,12 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
* @return string
*/
protected function _filterEscape($string) {
return preg_replace(
'/([\x00-\x1F\*\(\)\\\\])/e',
'"\\\\\".join("",unpack("H2","$1"))',
// see https://github.com/adldap/adLDAP/issues/22
return preg_replace_callback(
'/([\x00-\x1F\*\(\)\\\\])/',
function ($matches) {
return "\\".join("", unpack("H2", $matches[1]));
},
$string
);
}
......@@ -479,6 +482,10 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
protected function _openLDAP() {
if($this->con) return true; // connection already established
if($this->getConf('debug')) {
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
}
$this->bound = 0;
$port = $this->getConf('port');
......@@ -555,6 +562,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
if(!$bound) {
msg("LDAP: couldn't connect to LDAP server", -1);
$this->_debug(ldap_error($this->con), 0, __LINE__, __FILE__);
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment