浏览代码

Addressbook Fix. This code was suppose to allow the user to select
whether to have the fullname, nickname, ect... returned from the addressbook to
the the compose screen, but it was not working at all. Granted we do not have
an option for this yet either, but that will follow fairly quickly.

Thanks to William Bishop

Jimmy Conner 21 年之前
父节点
当前提交
e46abc71b8
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      functions/addressbook.php

+ 4 - 6
functions/addressbook.php

@@ -213,12 +213,10 @@ class AddressBook {
 
     function full_address($row) {
         global $addrsrch_fullname, $data_dir, $username;
-
-        if (($prefix = getPref($data_dir, $username, 'addrsrch_fullname') or
-            isset($addrsrch_fullname) and $prefix = $addrsrch_fullname)
-            and $prefix !== 'noprefix') {
-            $name = ($prefix === 'nickname') ? $row['nickname']
-                : $row['name'];
+        $prefix = getPref($data_dir, $username, 'addrsrch_fullname');
+        if (($prefix != "" || (isset($addrsrch_fullname) &&
+            $prefix == $addrsrch_fullname)) && $prefix != 'noprefix') {
+            $name = ($prefix == 'nickname' ? $row['nickname'] : $row['name']);
             return $name . ' <' . trim($row['email']) . '>';
         } else {
             return trim($row['email']);