[Kolab-devel] undefined indexes in several arrays

Andreas Hasenack andreas at conectiva.com.br
Thu Aug 18 16:26:43 CEST 2005


kolab seems to make several assumptions about array indexes always
existing. For example (referer ommited for brevity):

Undefined index:  kolabfilter-verify-from-header in /var/www/html/kolab/admin/service/index.php on line 87, ...
Undefined index:  kolabfilter-allow-sender-header in /var/www/html/kolab/admin/service/index.php on line 88, ...
Undefined index:  kolabfilter-reject-forged-from-header in /var/www/html/kolab/admin/service/index.php on line 89, ...

and many more.

The code there reads:
$kolabfilterverifyfrom = $attrs['kolabfilter-verify-from-header'][0];
$kolabfilterallowsender = $attrs['kolabfilter-allow-sender-header'][0];
$kolabfilterrejectforgedfrom = $attrs['kolabfilter-reject-forged-from-header'][0];

Some of these attributes only get inserted into LDAP when the user changes the
value to either TRUE or FALSE via the admin interface. After that, they are
always there.

So, is this an LDAP database initialization problem? Or should the code
be more careful and check if the index exists before attempting to use
it? Has anybody else seen this?




More information about the devel mailing list