Verified Commit 9214fc45 authored by dockx thibault's avatar dockx thibault
Browse files

:ambulance: (setup) - fixes ldap p1

backup and some fixes in ldap.
No related merge requests found
Showing with 6 additions and 6 deletions
+6 -6
...@@ -943,7 +943,7 @@ class LDAP ...@@ -943,7 +943,7 @@ class LDAP
if (!$this->dn_exists($cdn)) { if (!$this->dn_exists($cdn)) {
$type = preg_replace('/^([^=]+)=.*$/', '\\1', (string) $cdn); $type = preg_replace('/^([^=]+)=.*$/', '\\1', (string) $cdn);
$param = preg_replace('/^[^=]+=([^,]+).*$/', '\\1', (string) $cdn); $param = preg_replace('/^[^=]+=([^,]+).*$/', '\\1', (string) $cdn);
$param = preg_replace(['/\\\\,/','/\\\\"/'], [',','"'], $param); $param = preg_replace(['/\\\\,/','/\\\\"/'], [',','"'], (string) $param);
$na = []; $na = [];
...@@ -1106,7 +1106,7 @@ class LDAP ...@@ -1106,7 +1106,7 @@ class LDAP
{ {
$ret = []; $ret = [];
$url = preg_replace('!\?\?.*$!', '', (string) $url); $url = preg_replace('!\?\?.*$!', '', (string) $url);
$server = preg_replace('!^([^:]+://[^/]+)/.*$!', '\\1', $url); $server = preg_replace('!^([^:]+://[^/]+)/.*$!', '\\1', (string) $url);
if ($referrals === NULL) { if ($referrals === NULL) {
$referrals = $this->referrals; $referrals = $this->referrals;
...@@ -1500,13 +1500,13 @@ class LDAP ...@@ -1500,13 +1500,13 @@ class LDAP
/* Remove ' and " if needed */ /* Remove ' and " if needed */
$value = preg_replace('/^[\'"]/', '', (string) $value); $value = preg_replace('/^[\'"]/', '', (string) $value);
$value = preg_replace('/[\'"] *$/', '', $value); $value = preg_replace('/[\'"] *$/', '', (string) $value);
/* Convert to array if $ is inside... */ /* Convert to array if $ is inside... */
if (preg_match('/\$/', $value)) { if (preg_match('/\$/', (string) $value)) {
$container = preg_split('/\s*\$\s*/', $value); $container = preg_split('/\s*\$\s*/', (string) $value);
} else { } else {
$container = rtrim($value); $container = rtrim((string) $value);
} }
return $container; return $container;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment