瀏覽代碼

utf8_is_ascii deleted

Visman 8 年之前
父節點
當前提交
9379a19cb9
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      include/email.php

+ 4 - 4
include/email.php

@@ -52,10 +52,10 @@ function is_banned_email($email)
 //
 function encode_mail_text($str)
 {
-	if (utf8_is_ascii($str))
-		return $str;
-
-	return '=?UTF-8?B?'.base64_encode($str).'?=';
+    if (preg_match('%[^\x00-\x7F]%', $str)) {
+        return '=?UTF-8?B?'.base64_encode($str).'?=';
+    }
+    return $str;
 }