PHP:为什么 LDAP 过滤器不能使用“_”符号?

PHP: WHY LDAP filter does not work with "_" symbol?

关于从 ldap 服务器获取信息,我需要你的建议。 我的过滤器很简单,但它不起作用!

'filter' => "(u_someinfo=*)"

我发现过滤器名称中的符号“_”会产生错误 "Bad search filter"。 如果我写这样的代码:

'filter' => "(usomeinfo=*)"

它甚至可以工作 usomedata 在 ldap 中不存在! 可能必须有一些方法来解决它,但我不能做什么? 那么,有什么想法吗?

我从未在属性名称中看到过下划线;我认为属性中不允许使用下划线。

我发现了这个...https://www.rfc-editor.org/rfc/rfc2251#section-4.1.4

根据阅读,我认为只允许使用字母、数字和连字符。我也不记得曾经见过连字符。我个人只使用字母和数字来创建属性名称。

A specification may also assign one or more textual names for an attribute type. These names MUST begin with a letter, and only contain ASCII letters, digit characters and hyphens. They are case insensitive.