special handling of objectclass in search filters
This commit is contained in:
parent
7d9b6debde
commit
89d3dfc97b
|
@ -49,10 +49,16 @@ EqualityFilter.prototype.matches = function (target) {
|
||||||
if (typeof (target) !== 'object')
|
if (typeof (target) !== 'object')
|
||||||
throw new TypeError('target (object) required');
|
throw new TypeError('target (object) required');
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
|
||||||
if (target.hasOwnProperty(this.attribute)) {
|
if (target.hasOwnProperty(this.attribute)) {
|
||||||
var value = this.value;
|
var value = this.value;
|
||||||
return Filter.multi_test(
|
return Filter.multi_test(
|
||||||
function (v) { return value === v; },
|
function (v) {
|
||||||
|
if (self.attribute === 'objectclass')
|
||||||
|
v = v.toLowerCase();
|
||||||
|
return value === v;
|
||||||
|
},
|
||||||
target[this.attribute]);
|
target[this.attribute]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,8 +89,13 @@ SubstringFilter.prototype.matches = function (target) {
|
||||||
re += this['final'] + '$';
|
re += this['final'] + '$';
|
||||||
|
|
||||||
var matcher = new RegExp(re);
|
var matcher = new RegExp(re);
|
||||||
|
var self = this;
|
||||||
return Filter.multi_test(
|
return Filter.multi_test(
|
||||||
function (v) { return matcher.test(v); },
|
function (v) {
|
||||||
|
if (self.attribute === 'objectclass')
|
||||||
|
v = v.toLowerCase();
|
||||||
|
return matcher.test(v);
|
||||||
|
},
|
||||||
target[this.attribute]);
|
target[this.attribute]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue