Skip to content

Commit 7ef5081

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Tweak the code to avoid fabbot false positives
2 parents 84822b8 + 98dd0f4 commit 7ef5081

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Adapter/ExtLdap/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ private function getSingleEntry($con, $current): Entry
123123
$attributes = ldap_get_attributes($con, $current);
124124

125125
if (false === $attributes) {
126-
throw new LdapException(sprintf('Could not fetch attributes: %s.', ldap_error($con)));
126+
throw new LdapException('Could not fetch attributes: '.ldap_error($con));
127127
}
128128

129129
$attributes = $this->cleanupAttributes($attributes);
130130

131131
$dn = ldap_get_dn($con, $current);
132132

133133
if (false === $dn) {
134-
throw new LdapException(sprintf('Could not fetch DN: %s.', ldap_error($con)));
134+
throw new LdapException('Could not fetch DN: '.ldap_error($con));
135135
}
136136

137137
return new Entry($dn, $attributes);

Adapter/ExtLdap/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ private function connect()
140140
}
141141

142142
if (false === $this->connection) {
143-
throw new LdapException(sprintf('Could not connect to Ldap server: %s.', ldap_error($this->connection)));
143+
throw new LdapException('Could not connect to Ldap server: '.ldap_error($this->connection));
144144
}
145145

146146
if ('tls' === $this->config['encryption'] && false === @ldap_start_tls($this->connection)) {
147-
throw new LdapException(sprintf('Could not initiate TLS connection: %s.', ldap_error($this->connection)));
147+
throw new LdapException('Could not initiate TLS connection: '.ldap_error($this->connection));
148148
}
149149
}
150150

Adapter/ExtLdap/EntryManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function add(Entry $entry)
3838
$con = $this->getConnectionResource();
3939

4040
if (!@ldap_add($con, $entry->getDn(), $entry->getAttributes())) {
41-
throw new LdapException(sprintf('Could not add entry "%s": %s.', $entry->getDn(), ldap_error($con)));
41+
throw new LdapException(sprintf('Could not add entry "%s": '.ldap_error($con), $entry->getDn()));
4242
}
4343

4444
return $this;
@@ -52,7 +52,7 @@ public function update(Entry $entry)
5252
$con = $this->getConnectionResource();
5353

5454
if (!@ldap_modify($con, $entry->getDn(), $entry->getAttributes())) {
55-
throw new LdapException(sprintf('Could not update entry "%s": %s.', $entry->getDn(), ldap_error($con)));
55+
throw new LdapException(sprintf('Could not update entry "%s": '.ldap_error($con), $entry->getDn()));
5656
}
5757
}
5858

@@ -64,7 +64,7 @@ public function remove(Entry $entry)
6464
$con = $this->getConnectionResource();
6565

6666
if (!@ldap_delete($con, $entry->getDn())) {
67-
throw new LdapException(sprintf('Could not remove entry "%s": %s.', $entry->getDn(), ldap_error($con)));
67+
throw new LdapException(sprintf('Could not remove entry "%s": '.ldap_error($con), $entry->getDn()));
6868
}
6969
}
7070

@@ -106,7 +106,7 @@ public function rename(Entry $entry, $newRdn, $removeOldRdn = true)
106106
$con = $this->getConnectionResource();
107107

108108
if (!@ldap_rename($con, $entry->getDn(), $newRdn, null, $removeOldRdn)) {
109-
throw new LdapException(sprintf('Could not rename entry "%s" to "%s": %s.', $entry->getDn(), $newRdn, ldap_error($con)));
109+
throw new LdapException(sprintf('Could not rename entry "%s" to "%s": '.ldap_error($con), $entry->getDn(), $newRdn));
110110
}
111111
}
112112

Adapter/ExtLdap/Query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __destruct()
4949
continue;
5050
}
5151
if (!ldap_free_result($result)) {
52-
throw new LdapException(sprintf('Could not free results: %s.', ldap_error($con)));
52+
throw new LdapException('Could not free results: '.ldap_error($con));
5353
}
5454
}
5555
$this->results = null;

0 commit comments

Comments
 (0)