Skip to content

Commit 5e5e237

Browse files
committed
fix: corrected ldap_connect()
1 parent aaf66fe commit 5e5e237

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

phpmyfaq/config/ldap.php.original

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
// Main LDAP server
2+
// Main LDAP server, format the server as "ldap://127.0.0.1"
33
$PMF_LDAP['ldap_server'] = '';
44
$PMF_LDAP['ldap_port'] = 389;
55
$PMF_LDAP['ldap_user'] = '';

phpmyfaq/src/phpMyFAQ/Ldap.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,26 @@ class Ldap
3030
/**
3131
* Error.
3232
*
33-
* @var string
33+
* @var string|null
3434
*/
35-
public $error = null;
35+
public ?string $error = null;
3636

3737
/**
3838
* LDAP error number.
3939
*
40-
* @var int
40+
* @var int|null
4141
*/
42-
public $errno = null;
42+
public ?int $errno = null;
4343

4444
/**
4545
* @var array
4646
*/
47-
private $ldapConfig;
47+
private array $ldapConfig;
4848

4949
/**
5050
* @var Configuration
5151
*/
52-
private $config;
52+
private Configuration $config;
5353

5454
/**
5555
* An LDAP link identifier, returned by ldap_connect()
@@ -61,9 +61,9 @@ class Ldap
6161
/**
6262
* The LDAP base.
6363
*
64-
* @var string
64+
* @var string|null
6565
*/
66-
private $base = null;
66+
private ?string $base = null;
6767

6868
/**
6969
* Constructor.
@@ -99,7 +99,7 @@ public function connect(
9999
}
100100

101101
$this->base = $ldapBase;
102-
$this->ds = ldap_connect($ldapServer, $ldapPort);
102+
$this->ds = ldap_connect($ldapServer . ':' . $ldapPort);
103103

104104
if (!$this->ds) {
105105
$this->error = sprintf(

0 commit comments

Comments
 (0)