diff -urN ../roundcubemail-1.6.1.orig/program/lib/Roundcube/rcube_ldap.php ./program/lib/Roundcube/rcube_ldap.php --- ../roundcubemail-1.6.1.orig/program/lib/Roundcube/rcube_ldap.php 2023-01-23 22:03:14.000000000 +0200 +++ ./program/lib/Roundcube/rcube_ldap.php 2023-03-15 23:04:18.701117000 +0200 @@ -187,7 +187,7 @@ (array) ($this->coltypes['address']['subtypes'] ?? null), (array) ($this->coltypes['locality']['subtypes'] ?? null) ), - ] + (array) $this->coltypes['address']; + ] + (isset($this->coltypes['address']) ? (array) $this->coltypes['address'] : []); foreach (['street','locality','zipcode','region','country'] as $childcol) { if (!empty($this->coltypes[$childcol])) { @@ -803,6 +803,12 @@ */ function _entry_sort_cmp($a, $b) { + if ((!isset($a[$this->sort_col][0])) or ($a[$this->sort_col][0] === null)) { + return(((!isset($b[$this->sort_col][0])) or ($b[$this->sort_col][0] === null)) ? 0 : -1); + } + if ((!isset($b[$this->sort_col][0])) or ($b[$this->sort_col][0] === null)) { + return(((!isset($a[$this->sort_col][0])) or ($a[$this->sort_col][0] === null)) ? 0 : 1); + } return strcmp($a[$this->sort_col][0], $b[$this->sort_col][0]); }