浏览代码

Applied a fix for some formatting issue with mail adresses in the
foo@bar.org ()
format. It was submitted by "Kurt Yoder" <kylist@shcorp.com>

teepe 23 年之前
父节点
当前提交
70d15162d1
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      functions/imap_general.php

+ 9 - 1
functions/imap_general.php

@@ -349,7 +349,15 @@ function sqimap_find_displayable_name ($string) {
         $string = ereg_replace ('"', '', $regs[1] );
     }
     elseif ( ereg('\((.*)\)', $string, $regs) ) {
-        $string = $regs[1];
+        if( ( $regs[1] == '' ) || ( $regs[1] == ' ' ) ){
+            if ( ereg('^(.+) \(', $string, $regs) ) {
+               $string = ereg_replace( ' \(\)$', '', $string );
+            } else {
+               $string = '&nbsp';
+            }
+        } else {
+            $string = $regs[1];
+        }
     }
     else {
         $string = sqimap_find_email($string);