summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-01 19:26:28 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-01 19:26:28 (GMT)
commit6ab1a1b73e1cdc0a2ab76fd7c184b37dd9628480 (patch)
tree48d87a62575449aa642cb6a50d5143025ed04e92
parent7803d0ff71b339aa5a252cd62030be9bda965583 (diff)
downloadNet_LDAP3-6ab1a1b73e1cdc0a2ab76fd7c184b37dd9628480.tar.gz
Prevent miscomparison between a preferred sort on the client (application) and the configured sort on the serverpear-Net-LDAP3-1.0.0
-rw-r--r--lib/Net/LDAP3.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php
index b101b4a..1b3ac73 100644
--- a/lib/Net/LDAP3.php
+++ b/lib/Net/LDAP3.php
@@ -1847,12 +1847,15 @@ class Net_LDAP3
// Not passing any sort attributes means you don't care
if (!empty($sort_attrs)) {
$sort_attrs = (array) $sort_attrs;
- if (count(array_intersect($sort_attrs, $vlv_index[$base_dn]['sort'])) == count($sort_attrs)) {
- return $sort_attrs;
- }
- else {
- return false;
+ foreach ($vlv_index[$base_dn]['sort'] as $sss_config) {
+ if (count(array_intersect($sort_attrs, $sss_config)) == count($sort_attrs)) {
+ return $sort_attrs;
+ }
}
+
+ $this->_error("The requested sorting does not match any server-side sorting configuration");
+
+ return false;
}
else {
return $vlv_index[$base_dn]['sort'][0];