diff -urN turba.orig/lib/Driver/ldap.php turba/lib/Driver/ldap.php
--- turba.orig/lib/Driver/ldap.php	2008-06-09 04:28:07.000000000 +0100
+++ turba/lib/Driver/ldap.php	2008-09-30 11:36:04.000000000 +0100
@@ -542,6 +542,7 @@
         if (!is_array($var)) {
             return ($var != '');
         } else {
+            if (count($var) == 0) { return false; }
             foreach ($var as $v) {
                 if ($v == '') {
                     return false;
diff -urN turba.orig/lib/Driver.php turba/lib/Driver.php
--- turba.orig/lib/Driver.php	2008-09-22 13:17:13.000000000 +0100
+++ turba/lib/Driver.php	2008-09-30 12:54:09.000000000 +0100
@@ -1239,12 +1239,12 @@
 
             case 'photo':
             case 'logo':
-                $params = array('ENCODING' => 'b');
+                $params = array('ENCODING' => 'base64');
                 if (isset($hash[$key . 'type'])) {
                     $params['TYPE'] = $hash[$key . 'type'];
                 }
                 $vcard->setAttribute(String::upper($key),
-                                     base64_encode($val),
+                                     base64_encode($val) . "\r\n",
                                      $params);
                 break;
             }
@@ -1803,7 +1803,7 @@
                     break;
                 }
                 if (!isset($item['params']['ENCODING']) ||
-                    String::lower($item['params']['ENCODING']) != 'b') {
+                    String::lower($item['params']['ENCODING']) != 'base64') {
                     // Invalid property.
                     break;
                 }
diff -urN turba.orig/templates/browse/row.inc turba/templates/browse/row.inc
--- turba.orig/templates/browse/row.inc	2008-08-12 23:32:44.000000000 +0100
+++ turba/templates/browse/row.inc	2008-09-30 12:53:07.000000000 +0100
@@ -87,7 +87,7 @@
     }
     if ($ob->hasValue($this->columns[$c - 1])) {
         $value = $ob->getValue($this->columns[$c - 1]);
-        $shown_columns[$c] = htmlspecialchars($value);
+        $shown_columns[$c] = is_array($value) ? $value : htmlspecialchars($value);
         if ($type == 'email') {
             $value = Turba::formatEmailAddresses($value,
                                                  $ob->getValue('name'));