leenooks / phpLDAPadmin

phpLDAPadmin - Web based LDAP administration tool
www.phpldapadmin.org
GNU General Public License v2.0
520 stars 166 forks source link

htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated #220

Open protegh opened 1 year ago

protegh commented 1 year ago

You get the above error with php >= 8.1 when $server->getContainer($base->getDN()) in lib\HTMLTree.php returns a null object (that's the case if you have a short, one component, rootdn in your $servers->setValue('server','base',array(...) config.

protegh commented 1 year ago

Up to version 1.2.6.6 the lib/HTMLTree.php file was included but in the current master it was removed. So most likely my fix (a small change in lib/HTMLTree.php) isn't needed any more.

brendankearney commented 1 year ago

i was just playing around with HAProxy sending the Proxy Protocol headers to my LDAP instances, so that the original source IP of the connection was available to slapd. the slapd instance has to be started with a URL like "pldap://blah" and the olcServerID values must match as well. when i did this, i came across the error message here. reverting the configs back to "ldap://blah" stopped the error messages.

not sure if or how this might be related, but it seems to be.

vvatikiotis commented 12 months ago

Debian 11, phpldapadmin 1.2.6.3 and php8.2

Same error. The slapd instance runs as /usr/sbin/slapd -h ldap:/// ldapi:/// -g openldap -u openldap -F /etc/ldap/slapd.d. No olcServerID set.

williamdes commented 12 months ago

On what page does this occur?

brendankearney commented 12 months ago

for me, with HAProxy & Proxy Protocol, the initial page threw the error, and no other pages could be loaded. it seemed to affect them all, in my case.

vvatikiotis commented 12 months ago

In the Home page.

I added a few ACLs and it was magically fixed....

williamdes commented 12 months ago

In the Home page.

I added a few ACLs and it was magically fixed....

Okay, interesting

From the feedbacks I should have enough to investigate into it

By the way I am the one responsible for the phpldapadmin package on Debian now. Glad to see it's still used