leenooks / phpLDAPadmin

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

Undefined array key 0 on missing DN #250

Closed williamdes closed 10 months ago

williamdes commented 11 months ago

Describe the bug

Error
E_WARNING: Undefined array key 0
PHP Debug Backtrace
File    /var/www/phpldapadmin/lib/functions.php (192)
    Function    error ([a:5:{i:0;s:32:"E_WARNING: Undefined array key 0";i...](http://xxxxxx/tools/unserialize.php?index=0))
File    /var/www/phpldapadmin/lib/import_functions.php (184)
    Function    app_error_handler ([a:4:{i:0;i:2;i:1;s:21:"Undefined array key 0";i:2;...](http://xxxxxx/tools/unserialize.php?index=1))
File    /var/www/phpldapadmin/htdocs/import.php (54)
    Function    readEntry ([a:0:{}](http://xxxxx/tools/unserialize.php?index=2))
File    /var/www/phpldapadmin/htdocs/cmd.php (59)
    Function    include ([a:1:{i:0;s:39:"/var/www/phpldapadmin/htdocs/import...](http://xxxxxx/tools/unserialize.php?index=3))

To Reproduce

Import

version: 1
dn: dc=network

Expected behavior Show the error that exists in the code: A valid dn line is required

Additional context

phpLDAPadmin: 1.2.6.6

leenooks commented 10 months ago

Unable to reproduce the issue.

leenooks commented 10 months ago

OK, I was able to produce this. Looks like PLA is expecting a line between version and dn:.